Game Development Reference
In-Depth Information
Multiplying this expression by our matrix on the right, we have
v x i + v y j + v z k
vM =
M
= (v x i ) M + (v y j ) M + (v z k ) M
(4.8)
= v x ( iM ) + v y ( jM ) + v z ( kM )
= v x
m 11 m 12 m 13
+ v y
m 21 m 22 m 23
+ v z
m 31 m 32 m 33
.
Here we have confirmed an observation made in Section 4.1.7: the result
of a vector × matrix multiplication is a linear combination of the rows of
the matrix. The key is to interpret those row vectors as basis vectors.
In this interpretation, matrix multiplication is simply a compact way to
encode the operations for coordinate space transformations developed in
Section 3.3.3. A small change of notation will make this connection more
explicit. Remember that we introduced the convention to use the symbols
p , q , and r to refer to a set of basis vectors. Putting these vectors as rows
in our matrix M , we can rewrite the last line of Equation (4.8) as
2
4 p
3
5
vM =
v x v y v z
q
r
= v x p + v y q + v z r .
Let's summarize what we have said.
By understanding how the matrix transforms the standard basis vectors, we
know everything there is to know about the transformation. Since the re-
sults of transforming the standard basis are simply the rows 2 of the matrix,
we interpret those rows as the basis vectors of a coordinate space.
We now have a simple way to take an arbitrary matrix and visualize
what sort of transformation the matrix represents. Let's look at a couple
of examples—first, a 2D example to get ourselves warmed up, and then a
full-fledged 3D example. Examine the following 2 × 2 matrix:
2
1
M =
.
−1
2
2 It's rows in this topic. If you're using column vectors, it's the columns of the matrix.
Search WWH ::




Custom Search