Freya Holmér
Freya Holmér

@FreyaHolmer

7 Tweets 22 reads Dec 15, 2022
the four most common 3D rotation representations
this type of axis-angle form is also know as a rotation vector, where the magnitude represents the angle, and the axis represents the axis to rotate around
sometimes the axis and the angle are stored separately in 4 numbers (x,y,z,angle)
rotation matrices are pretty beefy memory-wise, but because they have all three axes directly stored in 9 numbers, transformations are very easy and fast. they also composite and combine well! (though not quickly)
euler angles are mostly used for user input and serialization - they interpolate horribly, don't composite well, and they suffer from an issue called gimbal lock, where you can accidentally lose a degree of freedom
unity's euler angles are technically called tait-bryan angles!
Quaternions (specifically, unit quaternions) are used to store rotations that interpolate and composite extremely computationally efficiently!
the downside is that the math inside is deeply esoteric, and so most people just treat it as a black box and move on with their lives
note that all of the rotation directions above use the left-hand rule, since I was teaching this in the context of Unity!
game engines generally use all of these in different situations:
• Angle-axis for the angular velocity (pseudo-)vector
• Euler angles for user input and serialization
• Rotation matrices for space transformation
• Quaternions for interpolation and compositing

Loading suggestions...