Understanding Rotation
Euler Angles and Their Limitations
Euler angles are one of the oldest and most widely used ways of describing an object's orientation in three-dimensional space. Developed by the 18th-century mathematician Leonhard Euler, they represent any orientation as a sequence of three rotations about coordinate axes, typically the X, Y, and Z axes. Because an orientation can be described using just three numbers, Euler angles have long been used in mechanics, astronomy, engineering, and, more recently, computer graphics.
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 angles themselves but also on the order in which they are applied. As a result, the same orientation can often be represented by multiple sets of Euler angles.
This dependence on rotation order can create problems during animation. When interpolating between keyframes, animation software often interpolates the three Euler rotation channels independently. Although this produces smooth curves for the individual angles, it does not necessarily produce the smoothest rotational motion in three-dimensional space. As a result, an object may follow an unexpectedly long path, rotate in an unintended direction, or suddenly flip between equivalent representations.
A more fundamental issue is a phenomenon known as gimbal lock. The name comes from a gimbal, a mechanical device consisting of three nested rings, each free to rotate about one axis. Together, the three rings provide three independent degrees of rotational freedom. Euler angles behave similarly, applying three rotations in sequence about three coordinate axes.
Normally, these 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 angles. To continue describing the motion, the animation software 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. Because these two rotations now act about the same direction, the system has lost one independent rotational degree of freedom.
Suppose the animator now wishes to rotate the object about the parent-space X axis. The current Euler representation can no longer express this as a simple change to the X rotation. Instead, the animation software may choose an equivalent representation, such as X = 90°, Y = 90°, Z = 90°, which produces exactly the same orientation while distributing the rotations differently among the three Euler angles.
Although the object's orientation is unchanged, the stored rotation values are now completely different. If one keyframe uses the first representation and the next keyframe uses the second, interpolation occurs between the numerical values rather than along the intended rotational motion. Instead of continuing smoothly, 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.
These limitations arise because Euler angles describe an orientation as a sequence of three rotations rather than as a single geometric rotation. They remain the primary interface for rotation in most animation software because they are intuitive, compact, and easy for animators to edit. However, their sequential nature makes them susceptible to interpolation artifacts and gimbal lock. Quaternions provide an alternative representation that describes the same orientations while avoiding these problems, making them better suited for interpolating rotational motion.
Quaternions: A Better Way to Represent Rotation
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 recognized their mathematical elegance and potential, quaternions were not widely adopted at the time. By the late nineteenth century, they had largely been replaced in mathematics, physics, and engineering by vector algebra and Euler angles, which were simpler to teach and more practical for many everyday problems. As a result, quaternions remained a relatively specialized topic for more than a century.
The emergence of computer graphics, robotics, and aerospace engineering changed that. As computers became responsible for calculating and interpolating three-dimensional rotations, the limitations of Euler angles became increasingly apparent. Engineers needed a representation that could describe orientations without suffering from gimbal lock or unpredictable interpolation. Quaternions turned out to provide exactly that, and today they are one of the standard ways of representing rotations in virtually every 3D graphics engine and animation system.
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, where i, j, and k are imaginary unit vectors. This forms 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.
The greatest advantage of quaternions is that they represent rotations continuously. There is no orientation at which the representation loses a degree of rotational freedom, so interpolation between two orientations remains smooth and well defined. Instead of interpolating three independent rotation channels, quaternion interpolation operates directly between the starting and ending orientations, producing a smooth rotational path that avoids the unexpected flips and twists that can occur with Euler angles.
Quaternions also make it straightforward to combine multiple rotations into a single orientation. Although the order in which rotations are applied still matters, the resulting orientation remains free from the singularities and interpolation artifacts associated with Euler angles. This makes quaternions particularly well suited for systems that repeatedly combine or blend rotations, such as skeletal animation, inverse kinematics, camera control, constraints, procedural animation, and physics simulation.
Despite these advantages, animators rarely work directly with quaternions. 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, animation software presents Euler rotation channels in the user interface. Thinking in terms of X, Y, and Z rotations makes posing and editing animation far more intuitive than manipulating quaternion values directly.
In Maya, however, the X, Y, and Z rotation channels are stored as separate animation curves and interpolated independently using cubic Bézier curves. Although the resulting orientations are frequently converted internally to quaternions whenever Maya evaluates constraints, blends orientations, performs inverse kinematics, or carries out other rotational calculations, the motion between keyframes is still determined by the interpolated Euler angle values. As a result, unexpected flips, long rotational paths, and other interpolation artifacts can still occur because the animation curves themselves are operating on Euler angles.
In practice, Euler angles and quaternions serve different roles. Euler angles provide an intuitive interface for creating and editing animation because they correspond directly to familiar X, Y, and Z rotation channels. Quaternions provide a mathematically robust representation that Maya uses whenever stable rotational calculations are required behind the scenes. Understanding the strengths and limitations of both explains why rotations feel intuitive when posing, yet can still become unpredictable when animating between keyframes.