Sunday, April 1, 2012

Gimble Lock and Rotation order in Maya

From: http://thinkanimation.blogspot.com/2007/03/maya-rigging-gimbal-big-no-no.html

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

No comments:

Post a Comment