Computer Graphics World


Issue link:

Contents of this Issue


Page 11 of 51

June 2009 10 Avoiding Gimbal Lock T o place an object in 3D space, its transformation proper- ties need to be specified: position, scale, and orientation. e first two attributes are easily definable by three numbers for each. e meaning of the x, y, and z positions and scale parameters are easy to understand, visualize, manipulate, and animate for art- ists. However, that is not the case for orientation. Using an xyz triplet (three angular values) to manipulate an object's orientation may become impossible—for instance, during some configurations of the three angles, such as gimbal lock—and lead to major problems when animating these values. Gimbal lock is a phenomenon known for a long time, and it has caused se- vere problems long before computer graphics emerged. According to NASA documents on the Apollo space program, pilots had to keep a close eye on the Gimbal Lock warning light while maneu- vering the spacecraft in order to avoid unwanted and dangerous malfunctioning in the guidance and control systems. e orientation, or angular position, of a rigid object has three degrees of freedom. By holding a camera in our hands, for ex- ample, we can pan left and right, tilt it up and down, or roll it without changing the point of interest. e most common and in- tuitive way to define these attributes is the use of Euler angles: e orientation is represented by three consecutive rotations around the main axes of a reference frame. However, the order of the ro- tational axes is something the industry has never agreed on, so it is essential to supply this information if we transfer animation data using Euler angles. Each major 3D application has a way to change the order of rotations. Using three gimbals, it is possible to construct a physical device, a gimbal system, based on the principle of Euler angles. A gimbal is a pivoted device, most often a ring, which rotates around a single axis. By mounting a gimbal inside another one, the inner ring ro- tates around an additional axis, increasing the degrees of freedom by one. Defining the orientation of an object with Euler angles is like putting it inside a virtual three-gimbal device, and then rotat- ing each ring by the corresponding angle. (Once again, the order of rotations and the coordinate frame axes must be agreed upon.) e outer ring can represent the tilt, the middle ring the pan, and the innermost ring the roll. However, most of the publications on Euler angles refer to the three attributes as yaw, pitch, and roll, as used in aerospace applications. Having full control over the three degrees of freedom, one could conclude that Euler angles (or gimbal systems, in general) are the perfect way to describe orientation. Unfortunately, there are con- figurations wherein we lose one degree of freedom: the gimbal lock. In this state, one of the gimbal rings is rotated such that it aligns perfectly with another. In this situation, the entire range of rotations is unreachable, and we may need to first re-orient the locked gimbal in order to rotate the ring arbitrarily. If the angles are near the gimbal-lock state, the gimbal system becomes unsta- ble, as even small rotations (or round-off errors of the numerical representation) may yield unexpected results. CG By GerGely Vass A former Maya TD and instructor, Gergely Vass eventually moved to the Image Science Team of Autodesk Media and Entertainment. Currently he is developing advanced postproduction tools for Colorfront in Hungary, one of Europe's lead- ing DI and post facilities. Vass can be reached at Astronauts, like animators, try to avoid gimbal lock. Shown here is the Apollo 15 control panel with the "eight ball" indicating the gimbal-lock danger zone with red.

Articles in this issue

Links on this page

Archives of this issue

view archives of Computer Graphics World - JUNE 09