Everything2
Near Matches
Ignore Exact
Full Text
Everything2

Gimbal Lock

created by koniosis

(thing) by koniosis (4.2 y) (print)   ?   (I like it!) 1 C! Sun Mar 28 2004 at 0:41:59

Gimbal Lock is a problem that arises when using Euler angles to perform rotations on objects in three dimensional space, most commonly experienced in 3D computer programs. It occurs when two axis become aligned during rotational operations. When this happens one degree of freedom is lost and cannot be regained using Euler angle rotations, an external intervention is required.

The reason Gimbal lock occurs is because when Euler angles are used to perform a rotation, each axis is processed independently, one after the other (e.g. X, Y then Z), leading to the possibility that an object could have its axis rotated such that by the time the last axis is processed one of the axis could be aligned to another, and due to the way Euler angles function, trying to perform a rotation while two axis are aligned will produce unexpected results.

For example, if we yaw (rotation about y-axis) 45° and then pitch (rotation about x-axis) -90° it is the equivalent of a pitch of -90° and then a roll (rotation about z-axis) of 45°. In fact, if the pitch rotation is ±90° it will cause the roll and yaw (z and x) axis to be aligned.

If this is hard to understand, try standing up, holding your arm stretched out so that it is parallel to the floor with your fingers extended (pointing away from you), now pitch your arm -90° (place your arm by your side, making your fingertips point towards the floor), now you can twist your arm (roll) without moving your body, but try walking around in a circle (keep your arm by your side) notice this is the same as rolling! But if you perform the same circle when your arm is out parallel to the ground it actually changes the direction your arm is pointing (yaw), you have just witnessed the y and z axis (yaw and roll) becoming aligned, a Gimbal Lock.

There is an interactive demo that can be used to demonstrate this at "http://gamemath.com/Euler.htm", try entering the angles as described to create a Gimbal lock and then try adjusting the "Heading" and "Bank" angles. Note: Heading = Yaw (y-axis), Bank = Roll (z-axis).

3D software and game developers will come across Gimbal lock at some point as it is a common and well known problem and can be very frustrating to debug without prior knowledge of its existence. Popular 3D modelling programs that use Euler Angles to perform rotations, and therefore suffer from Gimbal Lock include:

There are ways to keep Gimbal lock to a minimum when programming 3D rotations, if performing a rotation on only one axis, ensure it is the first axis to be processed, if performing two rotations, make sure they are the first and last axis to be processed.

To avoid Gimbal lock completely checks need to be placed in code whenever there is a chance of it occurring, or alternatively a different way of rotating can be used, specifically Quaternion Rotations. These types of rotation are confusing and hard to understand, but not particular hard to implement (see Quaternion).


References:
  • DUNN, Fletcher & PARBERRY, Ian (2002) "3D Math Primer for Graphics and Game Development": Worldware Publishing Inc. ISBN: 1-55622-911-9
  • Wikipedia - Gimbal Lock: "http://en.wikipedia.org/wiki/Gimbal_lock/" Accessed: 27 March 2004 23:48 GMT
  • Anticz.com - EularQuats: "http://www.anticz.com/eularqua.htm" Accessed: 27 March 2004 23:30 GMT
  • 3D Studio Max Website: "http://www.discreet.com/3dsmax/"
  • Lightwave Website: "http://www.newtek.com/products/lightwave/"
  • Maya Website: "http://www.alias.com/eng/products-services/maya/"
  • Softimage Website: "http://www.softimage.com/home/"

printable version
chaos

Quaternion Lightwave Euler Angles degrees of freedom
Persistence of Vision aspercreme Euler number Heading
angles Gimbal Malfunction 54 Sgt Pepper's Concert Party
Slowing of the Earth's Rotation Inertial navigation system double 3d modelling
Birmingham Apollo 13 Euler's constant wrist rotation
quaternion product Euler Euler network formula Euler cycle
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
The best nodes of all time:
A really good sandwich that ideath could make to take to work with her
journalism and technology
deism
Love poem from the monsters under my bed
postmodernism
Medieval European History
Ring of fire
Shylock
A community without shame has no future
Sometimes
transcendentalism
A Theological Justification for Homosexual Intercourse
a case for lowercase
New Writeups
Ctrl Y
cognitive dissonance(fiction)
SharQ
Gone Baby Gone(review)
halfWit
If I could, I'd title this "Freedom"(thing)
Roninspoon
Airline Hero(thing)
Ktistec
Why Women Are Always Cold(person)
doctor wilson
Drug policy reform(thing)
tejasa
Easy Raspberry Cheesecake(recipe)
Joysim
Drug policy reform(idea)
aneurin
Tyburn(place)
niruena
Boiling to death(idea)
artman2003
summer(thing)
doctor wilson
The Silver City and the Silent Sea(log)
Dreamvirus
The Silver City and the Silent Sea(poetry)
Aerobe
A nihilist's soulmate(poetry)
BookReader
Soup, of the green variety(recipe)
This page courtesy of The Everything Development Company