Skip to main content

Orientation (Rotation) Euler angles & Constraints

As mentioned in the previous article, all bones have an orientation (rotation). This orientation mainly affects how constraints behave, but can also have an effect on IK solvers.

How does rotation even work in 3D? (Euler gimbal)
The easiest/most comprehensible way of storing rotation is by having 3 axes, that affect each other in an order.
Unity lets you rotate objects this way, however behind the curtains all rotations are stored as quaternions (another more confusing way of storing rotation).
This GIF shows an order of X Y Z (Red-Green-Blue)
Euler Gimbal.gif
thereThis areorder 2heavily bigaffects perkshow ofobjects rotate, this system, Gimbal lock and what I call axis locking

Gimbal lock & quaternions
Gimbal lock is apretty problemimportant whereto you'reknow unablewhen you want an object to rotate overaround aone certain range withouaxis.
In the GIF below you can see, that using the order XYZ causes you to have to rotate all 3 axes for the object to appear to rotate around one.
ZYX works, because the object should rotate around the Z axis, and Z is the last axis in ZYX
Euler.gif

However we cannot change the Euler order in unity, so we need to align the objects at rest (at rest meaning that the rotation is 0,0,0)
The order unity uses is XZY, this means that objects should be aligned with the X axis at rest.