Graphics Programs Reference
In-Depth Information
We now select (Figure 1.22b) the plane
x
+
y
+
z
−
1=0andthepoint
P
=(1
,
1
,
1).
Equation (1.28) becomes
2(1+1+1
−
1)
1
3
(1
,
1
,
1)
.
P
∗
=(1
,
1
,
1)
−
(1
,
1
,
1) =
−
1+1+1
Similarly, point
P
=(0
,
0
,
0) is reflected to
2(0+0+0
−
1)
(1
,
1
,
1) =
2
P
∗
=(0
,
0
,
0)
−
3
(1
,
1
,
1)
.
1+1+1
The special case of a reflection about one of the coordinate planes is also obtained
from Equation (1.28).
The equation of the
xy
plane, for example, is
z
=0,where
Equation (1.28) yields
2(0+0+
z
+0)
0
2
+0
2
+1
2
P
∗
=(
x, y, z
)
−
(0
,
0
,
1) = (
x, y,
−
z
)
.
1.4.2 Rotation
Rotation in three dimensions is di
cult to visualize and is often confusing. One ap-
proach is to write three rotation matrices that rotate about the three coordinate axes:
⎛
⎞
⎛
⎞
⎛
⎞
cos
θ
−
sin
θ
00
cos
θ
0
−
sin
θ
0
10
0 0
sin
θ
cos
θ
00
0
1
0
0
0 os
θ
−
sin
θ
0
⎝
⎠
⎝
⎠
⎝
⎠
,
,
.
0
0
1
0
sin
θ
0
θ
0
0 in
θ
cos
θ
0
0
0
0
1
0
0
0
1
00
0 1
(1.29)
Let's look at the first of these matrices. Its third row and third column are (0
,
0
,
1
,
0),
which is why multiplying a point (
x, y, z,
1) by this matrix leaves its
z
coordinate un-
changed. The sines and cosines in the first two rows and two columns mix up the
x
and
y
coordinates in a way similar to a two-dimensional rotation [Equation (1.4)]. Thus,
this transformation matrix causes a rotation about the
z
axis. The two other matrices
rotate about the
y
and
x
axes.
(0,1,0)
y
y
(0,1,0)
y
(1,0,0)
x
x
x
z
z
z
(a)
(b)
(c)
Figure 1.23: Rotating About the Coordinate Axes.
Search WWH ::
Custom Search