Game Development Reference
In-Depth Information
1000
0100
T
1,
2 ,
3
0010
12 31
Applying the sequence of transformations in the order scaling, rotating,
and translating, we obtain:
pS
1, 0, 0, 1
p
(5)
pR
.707, 0,
.707, 1
p
y
pT
1.707, 2,
3.707, 1
One of the key benefits of matrices is that we can use matrix multipli-
cation to combine several transformations into one matrix. For
example, let's reconsider the example at the beginning of this section.
Let's combine the three transformation matrices into one matrix repre-
senting all three through matrix multiplication. Note that the order in
which we multiply the transformations is the order that they are
applied.
1
0
0
0
.
707
0
.
707
0
1
0
0
0
5
1
0
1
0
0
0
1
0
0
0
0
0
SR
T
5
y
.
707
0
.
707
0
0
0
1
0
1
0
0
0
0
0
0
1
1
2
3
1
5
(6)
0
0
0
1
.
1414
0
.
1414
0
0
1
0
0
Q
.
1414
0
.
1414
0
1
2
3
1
Then pQ = [1.707, 2, -3.707, 1].
The ability to combine transformations has performance implica-
tions. Suppose that we need to apply the same scaling, rotation, and
translation transformations to a large set of vectors (a common task in
3D graphics). Instead of applying a sequence of transformations, as we
did in equation (5), per vector, we can combine all three transforma-
tions into one matrix, as we did in equation (6). Then we only have to
Team-Fly ®
Search WWH ::




Custom Search