Unifying Transformations

How to 3D

Chapter 4: Transformation Machinery

Unifying Transformations

Our models are lonely. They need a broader world to occupy. They need to be situated near other models to form complex scenes. In an earlier chapter, we learned about three tools for moving models around: rotation, scale, and translation. We will use these transformations to arrange worlds.

The three transformations use three different mathematical operations: translation is vector addition, scaling is vector multiplication, and rotation is a combination of sine and cosine. These differences present a problem: if we want to apply a sequence of transformations, the code that combines them will be messy. Worlds are built out of many such sequences. A rock is rotated a bit, scaled up, and then translated into place next to a tree. The messes will lead to unmaintainable software if we don't find a better way to express transformation sequences.

In this chapter, we develop a unifying system of transformations that will compactly express any mixture of rotations, scales, and translations. The heart of the system is a mathematical structure called a matrix. By the chapter's end, you'll be able to answer the following questions:

Matrices are more complicated than the arithmetic and trigonometry that we used previously. Ultimately, however, the unified system will be simpler and faster. It has been adopted by nearly all graphics systems of the past several decades.

Dot Products →