Understanding Rotation
Euler Angles and Their Limitations
Euler angles are the standard way animators interact with rotation in most 3D animation software. Rather than describing an orientation directly, they represent it as a sequence of three rotations about the X, Y, and Z axes. Because each rotation is controlled independently, Euler angles are intuitive to understand, easy to edit, and naturally fit the channel-based workflow used by animation software.
Euler angles were developed by the eighteenth-century mathematician Leonhard Euler as a method for describing the orientation of rigid bodies. Long before computers existed, they were widely used in mechanics, astronomy, and engineering because any orientation could be represented using just three angles.
Mathematically, an Euler rotation is defined as a sequence of three rotations applied in a specific order. Although each rotation is represented by a single angle, the rotations are not independent. Each rotation changes the orientation of the axes used by subsequent rotations, so the final orientation depends not only on the three angle values but also on the order in which the rotations are applied. As a result, a single orientation can often be represented by multiple sets of Euler angles.
In Maya, the X, Y, and Z rotations are stored as three independent animation curves. Between keyframes, each rotation channel is interpolated separately using cubic Bézier curves. This gives animators precise control over each axis and allows familiar editing tools such as tangents, breakdowns, and animation layers to operate on the individual rotation channels.
The drawback is that interpolating the three rotation channels independently does not necessarily produce the smoothest rotational motion in three-dimensional space. An object may follow an unexpectedly long rotational path, rotate in an unintended direction, or suddenly flip, even though the key poses themselves appear correct. These problems arise because the animation curves are interpolating the Euler angle values rather than the three-dimensional orientation itself.
A more fundamental limitation is a phenomenon known as gimbal lock. The name comes from a gimbal, a mechanical device consisting of three nested rings, each able to rotate about one axis. Together, the three rings provide three independent degrees of rotational freedom. Euler angles work in much the same way, applying three rotations in sequence about three coordinate axes.
Normally, the three rotation axes remain independent. However, at certain orientations, two of the axes become perfectly aligned. When this happens, the aligned axes no longer represent independent directions of rotation. Rotating about either axis produces the same result, so one degree of rotational freedom is effectively lost. This loss of an independent rotational axis is known as gimbal lock.
A single pose at gimbal lock is not itself a problem. The difficulty arises when animating through such an orientation. Near a gimbal lock configuration, small changes in orientation can require very large changes in the Euler angle values. To continue describing the motion, Maya may switch to a different but mathematically equivalent set of Euler angles. Although both sets of angles represent exactly the same orientation, their numerical values can differ dramatically.
Consider the orientation X = 0°, Y = 90°, Z = 0° using an XYZ rotation order. After the 90° rotation about the Y axis, the X and Z rotation axes become aligned, placing the object in a gimbal lock configuration. If the animator then attempts to continue rotating about the parent-space X axis, Maya may choose an equivalent representation such as X = 90°, Y = 90°, Z = 90°. Although the object's orientation has not changed, the stored rotation values are now completely different.
If one keyframe uses the first representation and the next keyframe uses the second, Maya interpolates between the Euler angle values rather than the intended rotational motion. Instead of smoothly continuing the rotation, the object may twist unexpectedly or appear to flip. From the animator's perspective, nothing about the key poses suggests such dramatic movement, yet the interpolation appears to "break" because the underlying representation of the rotation has changed.
Euler angles remain the preferred interface for animation because they are intuitive, compact, and easy to edit. However, their channel-based representation makes them poorly suited for interpolating rotational motion. This is the problem that quaternions were designed to solve.
Quaternions: A Better Representation for Rotational Interpolation
Quaternions were introduced in 1843 by the Irish mathematician William Rowan Hamilton while searching for a mathematical system that could extend complex numbers into three dimensions. Although Hamilton immediately recognized their mathematical elegance, quaternions remained a relatively specialized topic until the emergence of computer graphics, robotics, and aerospace engineering, where robust three-dimensional rotation became essential.
Unlike Euler angles, which describe an orientation as a sequence of three separate rotations, a quaternion represents an orientation as a single rotation. Internally, this rotation is encoded as four numbers, commonly written as w + ix + jy + kz, which form a point on a four-dimensional unit sphere satisfying the equation w² + x² + y² + z² = 1. Although this representation is considerably less intuitive than Euler angles, it avoids the ambiguities and singularities that make Euler rotations difficult to interpolate.
Because a quaternion represents an orientation as a single rotation rather than three independent rotation channels, interpolation occurs directly between the starting and ending orientations. There is no orientation at which the representation loses a degree of rotational freedom, so the interpolation remains smooth and well defined throughout the motion. Instead of producing unexpected twists or flips, quaternion interpolation follows a continuous rotational path between the two poses.
Quaternions also make it straightforward to combine multiple rotations into a single orientation. Although the order in which rotations are applied still matters, quaternion calculations remain free from the singularities and interpolation artifacts associated with Euler angles. For this reason, quaternions are widely used throughout computer graphics for skeletal animation, inverse kinematics, constraints, camera control, procedural animation, and many other systems that depend on robust rotational calculations.
Despite these advantages, quaternions are rarely exposed directly to animators. A quaternion consists of four numerical values that do not correspond to intuitive concepts such as "rotate 30° about X." While they are mathematically elegant and computationally efficient, they are difficult for humans to visualize and edit directly.
For this reason, Maya presents Euler rotation channels in the user interface while using quaternions internally whenever stable rotational calculations are required. This naturally raises an important question: if Euler angles are easier to animate, but quaternions produce better rotational interpolation, is it possible to use both?
The tool presented in this chapter is built around that idea. Animators continue working entirely with familiar Euler rotation channels, creating and editing poses exactly as they normally would. The tool converts the Euler orientations at two keyframes into quaternions, performs spherical linear interpolation (SLERP) between those orientations, and then converts the interpolated quaternions back into Euler angles before baking the resulting rotations onto the object's animation curves.
Rather than interpolating at a constant rate, the interpolation is driven by a user-defined animation curve. For each frame between the two key poses, the animation curve provides the interpolation parameter used by the SLERP calculation. This separates the rotational path from its timing. The quaternion interpolation determines the smoothest rotational path between the two orientations, while the animation curve controls how quickly the object moves along that path. The result is an animation that preserves Maya's familiar Euler workflow while benefiting from the stability and predictability of quaternion interpolation.