Saturday 17 March 2007

how to avoid gimbal lock in rigging

Gimbal is a major pain in the rear . . .

. . . everybody knows that.
even if you animate in gimbal (set rotation tool to gimbal) you often have problems with it

"Gimbal" or "Euler" is how most 3d packages "think" about rotation values
it is a hierarchical system with rotation orders
the default rotation order is usually ZYX
If you Rotate in Z: X and Y rotate with it
If you Rotate in Y: X rotates with it but Z stays where it is
If you Rotate in X: Y and Z stay how they are

<- check it out

this is what happens under the hood when you have gimbal lock (ZYX)
maya does not know what axis you want to rotate when X and Z are overlaying

You can set the rotation order in the attribute editor
XYZ YXZ . . . .

The only thing that causes Gimbal Lock is the second axis

here is another video i did in XSI which nicely explains it for visual people.





This means for rigging in Maya or other Euler based apps:
DO NOT PUT THE Middle AXIS WHERE THERE IS MUCH MOVEMENT
2nd rotation BAD
1st or 3rd rotation GOOD

Put the middle rotation where there is little movement

For example a Head usually rotates a lot in Y (global axis)
it would be a good thing to make the rig that it does NOT use XYZ or ZYX order
best would be Y as THIRD (zxY, xzY)
and the "look up down" via 1st (since thats the second most used one)
use the middle axis for "left right tilt" since thats the least important one of those three

also you can change the rotation order as an animator
before you start animating
think about what your most and least used axis are going to be
then change the rotation order in the attribute editor
use the third one for most used
the middle one for least used
231 (1 most used, 3 least used)

once you have already animated your char and run into problems:
1.try GE ---Curves --- Euler filter
2.zooChangeRoo from the zootoolbox www.macaronikazoo.com

other apps allow keying the rotation order out of the box

6 comments:

Anonymous said...

This blog is very helpful. Like every one else who's done any rigging in Maya I know what it is, but I was never really clear as to how or why. Thanks

Anonymous said...

This post makes me more clear. thanks for this update.

Anonymous said...

I usually do not leave a comment, but the ideas really rocks, also I have a few questions like to ask, what's your contact details?

-Johnson

Kris Staber said...

good point
should put that up somehwere

kris.staber@gmail.com
+436508339348
gmt+1

Animation Freak said...

thanks for the post friend it was very helpful

Anonymous said...

Thank you very much, it was very helpful!