13
$\begingroup$

What are some practical uses for the Quaternion? Why not just use the Euler X, Y, and Z axis rotation values?

It's not intuitive how one should manipulate Quaternions. Can someone explain this?

$\endgroup$
2
  • $\begingroup$ I don't have much experience with it, but it helps avoid gimbal lock and is often used for animating rigs. $\endgroup$
    – gandalf3
    Mar 19, 2014 at 3:02
  • $\begingroup$ There's actually a good video in the Humane Rigging series that was referenced in the IRC channel just now: youtube.com/watch?v=FRD0PgsY3pU . It talks about gimbal lock and interpolation. $\endgroup$
    – Mutant Bob
    Apr 24, 2014 at 19:17

1 Answer 1

16
$\begingroup$

Quaternion has the advantage that it gives better interpolation between keyframes for arbitrary rotations, compared to euler or axis-angle, this is often used for character animation and why its default for armatures.

It also avoids the gimbal lock problem.

You make a good point that the f-curves are hard to control. Typically you wont manipulate each axis them directly, and instead pose the rig in the viewport.

So for walk cycles and arbitrary motion, quaternions are fine, Euler's are better if you want to control each axis and are animating something which inherently has separated axis you would want to apply in order (robotic joints for example - a gun turret where you might want to control 2 axis directly).


For more general info on this topic see:
https://stackoverflow.com/questions/8919086/why-are-quaternions-used-for-rotations

$\endgroup$
7
  • $\begingroup$ Ah hah! So, when you're moving something around multiple axes at once with a single movement! That makes sense -- that's exactly what the video I saw on YouTube was saying, that a quaternion describes rotation on multiple axes at once, so that makes perfect sense in the scenario you described of posing through the viewport. Thanks! $\endgroup$ Mar 19, 2014 at 5:12
  • $\begingroup$ So, with that scenario in mind, can you think of any time you might want to change the quaternion value in the W data field, other than maybe to reset it to it's default value? $\endgroup$ Mar 19, 2014 at 5:14
  • $\begingroup$ @ThomBlairIII - I cant think of any reasons to adjust the W, aside from the possibility of the axis switching from -1 to +1 between keyframes, but this isn't going to happen unless you already edit it manually or have imported f-curves. $\endgroup$
    – ideasman42
    Mar 19, 2014 at 6:56
  • $\begingroup$ @ideasman42 Do you know if Quaternion performs better than Euler with Inverse Kinematics, or are they both equal? Just curious. $\endgroup$
    – Mentalist
    Jan 25, 2017 at 3:53
  • 2
    $\begingroup$ If any more recent reader is interested in how quaternions work, there is a superb new visualization here $\endgroup$
    – Robin Betts
    Oct 28, 2018 at 19:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .