Game Development Reference
In-Depth Information
Let's now examine the contents of
M
:
2
4
r
11
r
12
r
13
3
2
4
1 0 0 0
3
0
5
5
r
21
r
22
r
23
0
0 1 0 0
0 0 1 0
∆x ∆y ∆z 1
M
=
RT
=
r
31
r
32
r
33
0
0
0
0
1
2
4
r
11
r
12
r
13
0
3
5
r
21
r
22
r
23
0
r
31
r
32
r
33
0
∆x ∆y ∆z 1
=
.
Notice that the upper 3×3 portion of
M
contains the rotation portion, and
the bottom row contains the translation portion. The rightmost column (for
now) will be [0,0,0,1]
T
.
Applying this information in reverse, we can take any 4 × 4 matrix and
separate it into a linear transformation portion, and a translation portion.
We can express this succinctly with block matrix notation, by assigning the
translation vector [∆x,∆y,∆z] to the vector
t
:
R 0
t
M
=
.
1
For the moment, we are assuming that the rightmost column of a 4 × 4
transformation matrix is always [0,0,0,1]
T
. We will begin to encounter
situations where this is not be the case in
Section 6.5.
Let's see what happens with the so-called “points at infinity” (those
vectors with w = 0). Multiplying by a “standard” 3 × 3 linear transfor-
mation matrix extended into 4D (a transformation that does not contain
translation), we get
2
4
r
11
r
12
r
13
3
5
0
Multiplying a “point at
infinity” by a 4 × 4
matrix WITHOUT
translation
r
21
r
22
r
23
0
x y z 0
r
31
r
32
r
33
0
0
0
0
1
=
xr
11
+yr
21
+zr
31
xr
12
+yr
22
+zr
32
xr
13
+yr
23
+zr
33
0
.
In other words, when we transform a point-at-infinity vector of the form
[x,y,z,0] by a transformation matrix containing rotation, scale, etc., the
Search WWH ::
Custom Search