Graphics Programs Reference
In-Depth Information
x
x
y
y
z
z
Figure 1.25: Direction of Three-Dimensional Rotations.
counterclockwise rotation. To achieve clockwise rotation, either use a negative angle or
the inverse of the rotation matrix. Inverting our rotation matrices is especially easy and
requires only that we change the signs of the sine functions.
Example . Consider the following compound transformation: (1) a translation by
l , m ,and n units along the three coordinate axes, (2) a rotation of θ degrees about the
x axis, (3) a rotation of φ degrees about the y axis, and (4) the reverse translation. The
four transformation matrices are
1000
0100
0010
lmn 1
10 00
01 00
00 10
T r =
,
T rr =
,
l
m
n
1
1
0
0
0
cos φ
0
sin φ
0
0 θ
sin θ
0
0
1
0
0
R x =
,
R y =
.
0
sin θ
cos θ
0
sin φ
0 φ
0
0
0
0
1
0
0
0
1
Their product equals the 4
×
4matrix
T = T r R x R y T rr
cos φ
0
sin φ
0
sin φ sin θ
cos θ
cos φ sin θ
0
cos θ sin φ
sin θ
cos φ cos θ
0
l + l cos φ
+ m cos( φ
m
+ m cos θ
[
2 n + n cos( φ
θ )
+ n cos( φ + θ )
1
=
.
θ ) / 2
m cos( φ + θ ) / 2
+ n sin( φ
n sin θ
2 l sin φ
θ ) / 2
+ n sin( φ + θ ) / 2
θ )
+ m sin( φ + θ )] / 2
m sin( φ
Substituting the values θ =30 , φ =45 ,and l = m = n =
1, we get the 4
×
4 matrix
0 . 7071
0
0 . 7071
0
0 . 3540
0 . 866
0 . 3540
0
T =
.
0 . 6124
0 . 50
0 . 6124
0
0 . 673
0 . 634
0 . 7410
1
Search WWH ::




Custom Search