1
$\begingroup$

I have a strange behaviour of the pass between 2 last keyframes of X and Z axis in full single rotations - instead of snapping the original state the model rotates backwards, both in Blender and c++ code? where can the problem presumably be? I, not that deep into Blender to guess the reasons myself:( Applying the recorded video describing the said above - thank you :)
https://youtu.be/tw0JBH1Bobo

$\endgroup$
0
$\begingroup$

It is because of the way quaternions work. To perform a single rotation from q=(1,0,0,0) around axis (0,0,1) it will go from (1,0,0,0) through (0,0,0,1) and return to its original orientation as (-1,0,0,0). Now it may seem strange to start at (1,0,0,0) and end at (-1,0,0,0) and still be in the same orientation, but that is just the way quaternions work. q and -q represent the same orientation.

Since you aren't ending your spin at (-1,0,0,0) that means the animation system animates the figure unspinning instead of completing the spin.

I first realized these properties of quaternions back in 2014 shortly after I asked How do I ensure a sequence of quaternions from matrix.decompose() is continuous? . Take a good look at the difference between the fcurve screenshot in the question and the screenshot in the accepted answer.

$\endgroup$
1
  • $\begingroup$ thank you, mate, I manully changed W component of the root bone quaternion of the last keyframe to -1.0 (it was 1.0f after copying from the first pose, as well as creating the last pose manually) - and the rotation works complete - thanks again :) $\endgroup$
    – auraxarr
    Jul 20 '17 at 17:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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