See all glossary terms

Euler Angles

Euler angles represent 3D rotations as three separate angles of rotation around the X, Y, and Z axes. Named after mathematician Leonhard Euler, this system describes any 3D orientation by applying three rotations, one at a time, around specified axes, commonly known as pitch (X-axis), yaw (Y-axis), and roll (Z-axis) in game development.
While Euler angles are intuitive for humans to understand and use in the 3D software, they suffer from a couple of limitations making them less than ideal for computations:
  • The representation for a given orientation is not unique. Different combinations of angles can result in the same orientation, leading to ambiguity.
  • Interpolating between two orientations can result in a state called "gimbal lock". Gimbal lock occurs when two of the three rotation axes align, causing the loss of one dimension or degree of freedom. This limitation exists because the rotation axes are not independent, leading to a situation where you cannot rotate around one axis without affecting the others.
Although game engine developers can work around the first limitation by implementing constraints to the three angles, the second limitation is a fundamental issue with the representation itself.
In Godot, gimbal lock can happen on any Node3D that uses rotation and rotation_degrees properties. The rotate(), rotate_x(), rotate_y(), and rotate_z() methods also can have this problem.
Gimbal lock is a built-in problem in Euler angles, but it can be avoided by using quaternions for rotations instead.
Here is a demonstration using Blender to rotate around the X, Y, and Z axes that lead to gimbal lock. With the "Gimbal" option enabled, you can see how two of the rotation axes can align, losing one degree of freedom.
For complex rotations in games, quaternions are often preferred over Euler angles as they avoid gimbal lock entirely, though they're less intuitive to work with directly.

See Also

Related terms in the Glossary