Page 25: Rotations: Summary
Spring 2026 Sample Solution
After all that discussion of rotations, you probably have two big questions:
- What does three actually do?
- What do you really need to know about rotations?
Part of 2023 Lecture 16 | Slides
Rotations in three
Three’s handling of rotations (and transformations in general) is quite general and flexible. It’s one of the nice things about three.
Three prefers to keep transformations separate: it stores position, orientation, and scale separately. It only combines them at the last possible moment when necessary for computation.
Internally, three stores orientations as quaternions. It performs all rotation computations using quaternions.
Three provides functions that let you use other forms of rotation representation. There are axis angle functions. There are Euler Angle functions. But, it converts these to quaternions for internal storage. This means that if you use other forms of rotations, it may have to make many conversions. For example, in the old spinning cube demo…
When we update the rotations by adding to the Euler Angles…
1cube.rotation.x += 0.5 * timeDelta;
2cube.rotation.y += 0.5 * timeDelta;It needs to convert from its internal representation (quaternion) to an euler angle (so it knows the euler angle value to add to), and then convert the updated quantity back. The conversions are hidden in the get/set accessors (JavaScript syntax magic). But, when you say rotation.x you are actually calling a “getter” function that converts the internal quaternion to euler angles. These conversions can sometimes have small numerical errors that build up over repeated computations.
However, most of the time, three’s internal use of quaternions is transparent. You can access the x/y/z of the euler angles. You can mix and match use of the euler angles with axis angle or quaternion operations. Or, you can ignore all of this and operate on the matrices yourself.
What to remember about rotations?
- Remember the definition in terms of rigid transformations.
- Know the properties of rotation matrices (which are the properties of rotations).
- Understand what rotations around single axes are, and why they are easy. A dirty secret: often rotations around a single axis are enough.
- Understand the basic challenges of rotation in 3D. Why does it get so tricky?
- Know the main types of 3D rotation representations: Euler Angles, Axis-Angle, Quaternions, and Rotation Matrices. You do not need to know the details of each, but you should have the intuitions for each, and what they are good and bad at.
- Gain an understanding of Euler Angles. How we use 3 rotations about fixed axes (often X,Y,Z) to represent arbitrary rotations. You should have a sense of their benefits (easy to specify) and their problems (gimbal lock, unintuitive interpretations, weird interpolations, …)
- Gain an understanding of Axis Angle representations. How we use a vector and an angle together to represent an arbitrary rotation.
- Learn the basic ideas of using Quaternions for representing rotations. You don’t need to know the details of how they work. You should have an intuition for why we like them so much.
- Understand the properties of rotation matrices, and why they aren’t necessarily a good way to compute with rotations.