Graphics Programs Reference
In-Depth Information
Exercise 3.18: Suppose that we first want to rotate the viewer about the origin and
then translate him to point B =( a, b, c ). The rotation requires three transformations, a
translation T 1 to the origin, a rotation T 2 about the origin, and a translation T 3 back
to (0 , 0 ,
k ). This must be followed by a translation T 4 from the standard position to
B . Show that the last two translations, T 3 and T 4 , can be replaced by one translation.
When reflections are included in addition to translations and rotations, more than
four transformation matrices may be needed. Figure 3.30a shows a simple example.
Given a viewer at (0 , 0 ,
1) and rotate
it 45 about the y axis (Figure 3.30b). The viewer can be considered a point which
has no dimensions and no “left” and “right” directions. Thus, the reflection moves the
viewer to another location but does not “reverse” him. However, the viewer and the
screen have to be treated and moved as a single unit, which is why a full treatment of
perspective projection should include a “top” vector that points in the direction of the
top of the screen. When the viewer-screen unit is reflected, the left and right sides of
the screen are reversed and the “top” vector changes direction (Figure 3.30c).
2), we want to reflect it about the plane ( x, 0 ,x
x
x
L
L
R
R
z
z
(a)
(b)
(c)
Figure 3.30: Reflecting the Viewer.
In general, a reflection about an arbitrary plane in three dimensions requires five
transformations: (1) a translation that brings one point of the plane to the origin, (2)
a rotation about the origin that brings the plane to one of the three coordinate planes,
(3) a reflection about that plane, (4) a reverse rotation, and (5) the reverse translation.
In many special cases, such as a plane parallel to one of the coordinate planes, this
process can be simplified, but in general a reflection followed by a rotation requires
eight (5 + 3) transformations. In order to apply the inverse transformations to points
on the object, we have to determine the inverses of all the transformation matrices
involved, but fortunately the inverses of translation, rotation, and reflection about one
of the coordinate planes are trivial to figure out.
It should again be emphasized that the viewer and the projection plane constitute
a single unit and should be transformed together. Even though the approach discussed
in this section transforms the object and not the viewer, it is still important to make
sure that the object remains on the other side of the projection plane from the viewer
after all the transformations. Thus, after an object point is transformed and before
it is projected, it is important to verify that its z coordinate is still nonnegative. It
is also important to make sure that enough points are selected on the object, because
otherwise it may happen that two points with nonnegative z coordinates are connected
Search WWH ::




Custom Search