Graphics Reference
In-Depth Information
The x , y , and z translation values of the transformation are the first three values of the fourth column
( d , h , and m in Eq. 2.9 ) . The upper left 3
3 submatrix represents rotation and scaling. Setting the upper
left 3
3 submatrix to an identity transformation and specifying only translation produces
Equation 2.10 .
2
4
3
5 ¼
2
4
3
5
2
4
3
5
x þ t x
y þ t y
z þ t z
1
100 t x
010 t y
001 t z
0001
x
y
1
(2.10)
A transformation consisting of only uniform scale is represented by the identity matrix with a scale
factor, S , replacing the first three elements along the diagonal ( a , f , and k in Eq. 2.9 ). Nonuniform scale
allows for independent scale factors to be applied to the x -, y -, and z -coordinates of a point and is
formed by placing S x , S y , and S z along the diagonal as shown in Equation 2.11 .
S x x
S y y
S z z
1
2
4
3
5 ¼
2
4
3
5
2
4
3
5
S x 000
0 S y 00
00 S z 0
0001
x
y
1
(2.11)
Uniform scale can also be represented by setting the lowest rightmost value to 1/ S ,asin
Equation 2.12 . In the homogeneous representation, the coordinates of the point represented are deter-
mined by dividing the first three elements of the vector by the fourth, thus scaling up the values by the
scale factor S. This technique invalidates the assumption that the only time the lowest rightmost ele-
ment is not one is during perspective and therefore should be used with care or avoided altogether.
2
4
3
5
2
4
3
5
2
4
3
5
2
4
3
5
x
y
z
x
y
1
S
1000
0100
0010
000 1
S
S x x
S y y
S z z
1
¼
¼
(2.12)
1
3 submatrix ( a , b , c , e , f , g , i , j , and k of
Eq. 2.9 ) . Rotation matrices around the x -, y -, and z -axis are shown in Equations 2.13-2.15 , respectively.
In a right-handed coordinate system, a positive angle of rotation produces a counterclockwise rotation
as viewed from the positive end of the axis looking toward the origin (the right-hand rule). In
a left-handed (right-handed) coordinate system, a positive angle of rotation produces a clockwise
(counterclockwise) rotation as viewed from the positive end of an axis. This can be remembered by
noting that when pointing the thumb of the left (right) hand in the direction of the positive axis, the
fingers wrap clockwise (counterclockwise) around the closed hand when viewed from the end of
the thumb.
Values to represent rotation are set in the upper left 3
2
3
2
3
2
3
0
10 00
0
x
y
1
x
4
5 ¼
4
5
4
5
0
y
sin y 0
0 sin y cos y 0
00 01
cos y
(2.13)
0
z
1
 
Search WWH ::




Custom Search