Game Development Reference
In-Depth Information
From Section 4.1.6, we know that matrix multiplication is associative,
and so we could compute one matrix to transform directly from object to
camera space:
p cam = ( p obj M obj→wld ) M wld→cam
= p obj ( M obj→wld M wld→cam ).
Thus, we can concatenate the matrices outside the vertex loop, and have
only one matrix multiplication inside the loop (remember there are many
vertices):
M obj→cam = M obj→wld M wld→cam ,
p cam = p obj M obj→cam .
So we see that matrix concatenation works from an algebraic perspective
by using the associative property of matrix multiplication. Let's see if we
can get a more geometric interpretation of what's going on. Recall from
Section 4.2, our breakthrough discovery, that the rows of a matrix contain
the result of transforming the standard basis vectors. This is true even in
the case of multiple transformations. Notice that in the matrix product
AB , each resulting row is the product of the corresponding row from A
times the matrix B . In other words, let the row vectors a 1 , a 2 , and a 3
stand for the rows of A . Then matrix multiplication can alternatively be
written as
2
4 a 1
3
0
2
4 a 1
3
1
2
4 a 1 B
3
5
@
5
A
5
A =
a 2
,
AB =
a 2
=
a 3 B
a 2 B
.
B
a 3
a 3
This explicitly shows that the rows of the product of AB are actually the
result of transforming the basis vectors in A by B .
5.7
Classes of Transformations
We can classify transformations according to several criteria. This section
discuss classes of transformations. For each class, we describe the properties
of the transformations that belong to that class and specify which of the
primitive transformations from Sections 5.1 through 5.5 belong to that class.
The classes of transformations are not mutually exclusive, nor do they
necessarily follow an “order” or “hierarchy,” with each one more or less
restrictive than the next.
When we discuss transformations in general, we may make use of the
synonymous terms mapping or function. In the most general sense, a map-
ping is simply a rule that takes an input and produces an output. We
 
Search WWH ::




Custom Search