Rotating with Quaternions
If you can’t remember me saying it before, you’ll be sure to hear me say it numerous times throughout this chapter: quaternions are an advanced mathematical construct. They are so advanced I don’t expect you to fully comprehend them by the end of this chapter. However, what I want you to take away is a healthy appreciation for what they do with respect to solving the gimbal lock issue we discussed in Chapter 15, Navigating the View Space.
Besides their usefulness in calculating 3D rotations, quaternions are useful in numerous fields, including computer vision, crystallographic texture analysis, and quantum mechanics. Conceptually, quaternions live in a 4D space through the addition of another dimension to those of the x
, y
, and z
axes used by Euler angles.
In this chapter, we will start with an overview of quaternions and delve into the benefits of their 4D structure. This will reveal how they can be used to replace operations...