Game Development Reference
In-Depth Information
Chapter 5
Matrices and Linear
Transformations
It's time to transform!
Super WHY!
Chapter 4 investigated some of the basic mathematical properties of ma-
trices. It also developed a geometric understanding of matrices and their
relationship to coordinate space transformations in general. This chapter
continues our investigation of transformations.
To be more specific, this chapter is concerned with expressing linear
transformations in 3D using 3 × 3 matrices. We give a more formal defini-
tion of linear transformations at the end of this chapter, but for now, recall
from our informal introduction to linear transformations in Section 4.2 that
one important property of linear transformations is that they do not con-
tain translation. A transformation that contains translation is known as an
a ne transformation. A ne transformations in 3D cannot be implemented
using 3 × 3 matrices. Section 5.7.2 gives a formal definition of a ne trans-
formations, and Section 6.4 shows how to use 4 × 4 matrices to represent
a ne transformations.
This chapter discusses the implementation of linear transformations via
matrices. It is divided roughly into two parts. In the first part, Sec-
tions 5.1-5.5, we take the basic tools from previous chapters to derive
matrices for primitive linear transformations of rotation, scaling, ortho-
graphic projection, reflection, and shearing. For each transformation, ex-
amples and equations in 2D and 3D are given. The same strategy will
be used repeatedly: determine what happens to the standard basis vec-
tors as a result of the transformation and then put those transformed
basis vectors into the rows of our matrix. Note that these discussions
assume an active transformation: the object is transformed while the co-
ordinate space remains stationary. Remember from Section 3.3.1 that we
can effectively perform a passive transformation (transform the coordinate
137
Search WWH ::




Custom Search