Graphics Reference
In-Depth Information
which expands to
x
y
1
10 p x
01 p y
00 1
cos( β )
sin( β )0
10
p x
x
y
1
=
·
·
·
sin( β )
cos( β )0
01
p y
00 1
0
0
1
We can now concatenate these matrices into a single matrix by multiplying
them together. Let's begin by multiplying the rotate β and the translate
(
p x ,
p y ) matrices together. This produces
x
y
1
10 p x
01 p y
00 1
cos( β )
sin( β )
p x cos( β )+ p y sin( β )
x
y
1
=
·
·
sin( β )
s( β )
p x sin( β )
p y cos( β )
0
0
1
and finally
x
y
1
cos( β )
sin( β )
p x (1
cos( β )) + p y sin( β )
x
y
1
=
·
(7.48)
sin( β )
cos( β )
p y (1
cos( β ))
p x sin( β )
0
0
1
which is the same as the previous transform (7.42).
I hope it is now is obvious to the reader that one can derive all sorts of
transforms either algebraically, or by using matrices - it is just a question of
convenience.
7.4 3D Transformations
Now we come to transformations in three dimensions, where we apply the
same reasoning as in two dimensions. Scaling and translation are basically
the same, but where in 2D we rotated a shape about a point, in 3D we rotate
an object about an axis.
7.4.1 3D Translation
The algebra is so simple for 3D translation that we can write the homogeneous
matrix directly:
x
y
z
1
100 t x
010 t y
001 t z
000 1
x
y
z
1
·
=
(7.49)
7.4.2 3D Scaling
The algebra for 3D scaling is
x = s x x
y = s y y
z = s z z
(7.50)
Search WWH ::




Custom Search