Game Development Reference
In-Depth Information
Rotation Order and Gimbal Lock
Rotation order indicates which rotations get evaluated first; the default order is
xyz, meaning the Z axis is evaluated first, then the Y axis, and finally the X axis.
This means that when you rotate around the Z axis, the Y and X move with it; ro-
tating around the Y axis will move the X axis; and rotating the X axis will only
move itself.
Having an incorrect rotation order will result in what's known as gimbal lock .
This occurs when two axes end up existing along the same plane; you can't get
the third degree of rotation because it clashes with another. This can cause your
objects to flip, and ultimately not move as you require.
Unless you are animating using the gimbal setting in the Rotate tool options (the
default setting is Local), this phenomenon is hidden to you. Maya will maintain
the 90-degree offset of rotation planes by adding rotational values to the other
axes as needed. By carefully considering your character's movements in advance,
you can prevent some gimbal lock problems. Setting the correct rotation order (in
the Attributes Editor) is a crucial step.
Look at Figure 12.68 , left; these are our current gimbal rotational axes. To make these set-
tings available, open the Rotate tool options and set Rotate Mode to Gimbal.
FIGURE 12.68 Gimbal lock example
IfwerotateroundtheYaxis,theXaxisturnswithit( Figure 12.68 , middle),buttheZaxis
doesn't. This means the Z axis will eventually be in the same place as the X, resulting in
gimballock.Thishappensbecause,bydefault,theYaxisisevaluatedsecond,meaningthe
X axis will move with it but the z will not.
Changingtherotationordertozxy(orxzy,dependingonhowyouwishtheobjecttorotate)
will mean the axes are evaluated correctly; as you can see in Figure 12.68 , right, when the
Y axis is rotated, all the other axes follow.
Search WWH ::




Custom Search