Professional Documents
Culture Documents
Rotation About an
Arbitrary Axis
9.1
Quick Review
118
= RxT
Ry 1
= RyT
Rz 1
= RzT
This means in particular that these matrices are orthogonal. It can also be
proven that the product of two orthogonal matrices is itself an orthogonal matrix
(see problems at the end of the chapter). So, if we combine several rotations
about the coordinate axis, the matrix of the resulting transformation is itself an
orthogonal matrix.
One way of implementing a rotation about an arbitrary axis through the
origin is to combine rotations about the z, y, and x axes. The matrix of the
resulting transformation, Rxyz , is
2
3
Cy Cz
Cy Sz
Sy
Sx Sy Sz + Cx Cz
Sx Cy 5 (9.1)
Rxyz = Rx Ry Rz = 4 Sx Sy Cz + Cx Sz
Cx Sy Cz + Sx Sz Cx Sy Sz + Sx Cz
Cx Cy
where
Ci = cos
and Si = sin
for i = x; y; z
From what we noticed above, Rxyz is an orthogonal matrix. This means that
its inverse is its transpose.
9.2
Goal: Rotate a vector v = (x; y; z) about a general axis with direction vector rb
(assume rb is a unit vector, if not, normalize it) by an angle (see gure 9.1).
Because it is clear we are talking about vectors, and vectors only, we will omit
the arrow used with vector notation.
We begin by decomposing v into two components: one parallel to rb and one
perpendicular to rb. Let us denote vk the component parallel to rb and v? the
component perpendicular to rb. You will recall from our study of vectors that
vk
Similarly,
= comprbv
v rb
b
=
2r
kb
rk
= (v rb) rb since rb is a unit vector
v?
=
=
orthrbv
v (v rb) rb
Figure 9.1: Rotation about a general axis through the origin, showing the axis
of rotation and the plane of rotation (see [VB1])
Let T denote the rotation we are studying. We need to compute T (v).
T (v)
= T vk + v?
= T vk + T (v? )
120
Figure 9.2: Rotation about a general axis through the origin, showing vectors
on the plane of rotation (see [VB1])
So, T (v? ) is the only quantity we need to compute. For this, we create a two
dimensional basis in the plane of rotation (see gure 9.1 and 9.2). We will use
v? as our rst basis vector. For our second, we can use
w
=
=
rb
rb
(9.2)
v?
v
cos v? + sin w
cos v? + sin (b
r
v)
and therefore
T (v)
= vk + T (v? )
(1
v)
v)
v)
v)
=
2
i
ux
vx
j
uy
vy
uy v z
= 4 u z vx
ux vy
2
0
= 4 uz
uy
k
uz
vz
3
uz vy
u x vz 5
uy v x
uz
0
ux
3
uy
ux 5 v
0
122
Proof.
u v = ux vx + uy vy + uz vz
So,
(u v) u
(ux vx + uy vy + uz vz ) u
2
3
ux
= (ux vx + uy vy + uz vz ) 4 uy 5
uz
3
2
2
ux uy ux uz
ux
uy uz 5 v
u2y
= 4 ux uy
ux uz uy uz
u2z
where
(1
rb =
=
cos
sin
t =
3
0
0 5 cos v+ sin
1
3
0 0
1 0 5 cos + sin
0 1
3
0
1
0
5v
3
0
uz uy
4 uz
0
ux 5 v
uy ux
0
2
39
0
uz uy
=
4 uz
0
ux 5 v
;
uy ux
0
(ux ; uy ; uz )
cos
9.3
Assignment
9.3. ASSIGNMENT
123
Bibliography
[BF1] Burden, Richard L., and Faires, Douglas J., Numerical Analysis,Brooks/Cole, sixth edition, 1997.
[BG1] Burger, Peter, and Gillies, Duncan, Interactive Computer Graphics,
Addison-Wesley, 1990.
[DD1] Deitel, H.M., and Deitel, P. J., Java, How to Program, Prentice Hall,
1999.
[DP1] Dunn, Fletcher and Parberry, Ian, 3D Math Primer for Graphics and
Game Development, Wordware Publishing, Inc., 2002.
[FD1] Foley, J.D., Van Dam, A., Feiner, S.K., and Hughes, J.F., Computer
Graphics, Principles and Practices, Addison-Wesley, 1995.
[FD2] Foley, J.D., Van Dam, A., Feiner, S.K., Hughes, J.F., and Philipps, R.L.,
Introduction to Computer Graphics, Addison-Wesley, 1997.
[H1]
Hill, F.S. JR., Computer Graphics Using Open GL, Prentice Hall, 2001.
134
BIBLIOGRAPHY
[WG1] Wall, David, and Gri th, Arthur, Graphics Programming with JFC,
Wiley, 1999.
[AW1] Watt, Alan, 3D Computer Graphics, Addison-Wesley, 2000.
[AW2] Watt, Alan, The Computer Image, Addison-Wesley, 1999.