Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm trying to animate in-between keyframes for skeletal animation but having some issues. Each joint is represented by a quaternion and there is no translation component. When I try to slerp between the orientations at the two key frames, I got a very wacky animation. I know my skinning equation is right because the animation is perfectly fine when the animation is directly on a keyframe rather than in-between two.

I'm using glm's built in mix function to do the slerp, so I don't think there are any problems with the actual slerp implementation.

There's really one thing left that could be wrong here. I must not be in the correct space to do slerp. Right now the orientations are in joint local space. Do I have to be in world space? In some other space along the way? I have the bind pose matrix and world-space transformation matrix at my disposal if those are needed.

share|improve this question
2  
A code snippet may help, possibly with hard numbers showing the quaternion values at two keyframes and the value of the interpolation between the two. –  Byte56 Apr 17 '12 at 21:22
add comment

1 Answer

Stumbled upon this post: http://www.gamedev.net/topic/605007-animation-transitions/

Interpolation doesn't work too well when the dot product of the two quaternions is less than 0. If this is the case, I just negate one of them and then do the slerp.

share|improve this answer
2  
Note: this should be done by you, when you prepare your animation data. All quaternions stored in your animation should have a positive W component; that way, the interpolation will always go the "right" way (ie: the short path). –  Nicol Bolas Apr 17 '12 at 23:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.