Page 128 - DCAP504_Computer Graphics
P. 128
Unit 8: 3-D in Computer Graphics
Assume that a point P is an arbitrary point with coordinates(x, y, z). It is rotated through an angle φ
about the x-axis which does not alter. Now, we redraw the figure as a view from the y-z plane.
The figure 8.10 depicts 3-D rotation.
Figure 8.10 : 3-D Rotation
In the Figure 8.10 the point P is rotated through an angle θ about the x-axis to position P (the positive x-
axis is assumed to be out of the page).
The coordinates of P are given by (x, y, z) and those of P’ are (x, y, z) as shown in figure 8.10.
The angle of rotation is assumed to be anti-clockwise (when considered from a
perspective in which the rotation is viewed down the x-axis (from the positive end)
looking towards the origin).
Using the standard trigonometric equations, we can express the transformed coordinates in terms of θ
and φ as
x’= p’cos (φ+θ) =p’cosφcos θ-p’sin φsinθ……………………………… (1)
y’= p’sin (φ+θ) = p’cosφsin θ+p’sin φcosθ…………………………….. (2)
In the polar form the original coordinates are given in the form:
x = p’cos φ
y = p’sin φ………………………………………………………… (3)
These equations are substituted in (1) and (2), we get the transformation equations for rotating a point
(x, y) through an angle θ about the origin as:
x’=xcosθ-y sinθy’=xsinθ+ycosθ …………………………………………. (4)
The equations given above can be written as in matrix form as:
P’= P.R
cos θ sin θ
[x’ y’]=[x y] …………………………………………….. (5)
− sin θ cos θ
where, R is a rotation matrix and is given as
cos θ sin θ
R= ……………………………………………………… (6)
− sin θ cos θ
LOVELY PROFESSIONAL UNIVERSITY 121