• ### Announcements

• #### Wondering what's new and changed at GameDev.net?06/20/17

Check out the latest Staff Blog update that talks about what's changed, what's new, and what's up with these "Pixels".
Followers 0

# OpenGL Problem with md5 viewer

## 5 posts in this topic

Hey, I recently coded an md5 viewer using opengl + sdl2 in windows and have come across a really strange issue. My geometry kind of explodes on certain frames, so one of the first things i tried was disabling interpolation, which "fixed" my problem. I've been stuck on this for a couple of days now. I'm currently using a model and anim straight from doom 3 so I know they aren't corrupt.

Here's a vid of what's happening.

Edited by Chris528
0

##### Share on other sites

Just a guess, I think your quaternion interpolation is broken. Maybe try disabling it and see if everything else works correctly?

1

##### Share on other sites

Just a guess, I think your quaternion interpolation is broken. Maybe try disabling it and see if everything else works correctly?

Yeah, it has to do with the interpolation of the joint orientations. One thing i tried is glm::mix( joint0.m_Orient, joint0.m_Orient, fInterpolate ); That stopped the glitching but causes twitching as it isn't really being interpolated anymore.  It appears that there is something wrong with the way glm::mix is handling things. I even checked the value of  fInterpolate and that seems to be working correctly. Here's the current code.

finalJoint.m_Orient = glm::mix( joint0.m_Orient, joint1.m_Orient, fInterpolate );

Edited by Chris528
0

##### Share on other sites

I figured out the issue, I tried out an earlier version of glm and it worked. It appears that glm::mix is implemented in a different manner than newer versions of glm.

0

##### Share on other sites

Just in case if you didn't notice, there is glm::slerp in the newer versions. The older versions of glm probably used mix as slerp.

1

##### Share on other sites

Just in case if you didn't notice, there is glm::slerp in the newer versions. The older versions of glm probably used mix as slerp.

Thanks, I did notice that there is glm::slerp, I just hadn't really tried it as there was a problem having to do with there being two versions of glm::slerp having the same arguments, one defined in quaternion.hpp and another in compatibility.hpp. I fixed it by making a small hack to compatibility.hpp. (added an additional namespace inside of glm). After getting that out of the way, the program compiled and everything worked. Thanks for your help, I appreciate it.

Edited by Chris528
0