Graphics Programs Reference
In-Depth Information
Exercise 3.10: The previous paragraph has mentioned scaling , so let's consider another
subtle effect of this simple transformation. The transformation matrix for scaling is
T 1 000
0 T 2 00
00 T 3 0
0001
.
When combined with perspective projection, it yields
T 1 000
0 T 2 00
00 T 3 0
0001
1000
0100
000 r
0001
T 1 00 0
0 T 2 00
000 T 3 r
0001
=
.
Hence, a point ( x, y, z, 1) is transformed to ( T 1 x, T 2 y, 0 ,T 3 rz + 1), which implies
T 1 x
T 3 rz +1 ,
T 2 y
T 3 rz +1 .
x =
y =
In the special case of uniform scaling, T 1 = T 2 = T 3 = T ,weget x = x/ ( rz +1 /T ),
y = y/ ( rz +1 /T ). The problem is that when T gets large (large magnification), 1 /T
becomes small, resulting in
x
rz
= xk
z
y
rz
= yk
z
x
y
,
.
We don't seem to get the expected magnification. What's the explanation?
The rightmost column of matrix T of Equation (3.5) is important and will serve
(on page 110) to illuminate the properties of the general perspective projection. The
three top elements of this column are 0, 1, and 0. The reader may remember that the
general transformation matrix [Equation (1.23)] denotes these elements by p , q ,and r .
Thus, element q of matrix T is nonzero. It has already been mentioned that element r
of matrix T p is nonzero because the viewer is positioned on the z axis. The reason that
element q of matrix T is nonzero is the rotation about the x axis. We can interpret this
rotation either as a rotation of the point or as a rotation of the coordinate system. In
the latter case, this rotation has changed the projection plane from the xy plane to the
xz plane and has also moved the viewer (because the viewer and the projection plane
constitute one unit) from his standard position on the z axis to a new location on the
y axis (Figure 3.25b). The fact that q is nonzero tells us that the y axis now intercepts
the projection plane. Page 110 sheds more light on the function of matrix elements p ,
q ,and r .
Exercise 3.11: Compute the coordinates of the object point P that happens to be
projected to the origin after the three transformations.
Negative z coordinates . It has already been mentioned several times that the
viewer and the object have to be located on different sides of the projection plane. In
Search WWH ::




Custom Search