Graphics Programs Reference
In-Depth Information
the standard position, this means that all the object points have to have nonnegative
z coordinates. This example shows what happens when object points have invalid
coordinates. (See also Exercise 3.19.) Figure 3.26a shows the two points P 1 =(0 , 1 ,
1)
and P 2 =(0 , 1 , 1) and a viewer located at (0 , 0 ,
3). When Equation (3.1) is used to
project the two points, the results are
P 1 = 0 ,
1 / 3) + 1 , 0 =(0 , 3 / 2 , 0)
P 2 = 0 ,
(1 / 3) + 1 , 0 =(0 , 3 / 4 , 0) .
1
1
and
(
The result seems to make sense, but Figure 3.26b shows that when P 1 is moved to the
left (i.e., toward larger negative z values), its projection climbs up the y axis quickly
and without limit, thereby creating a distorted projection of the entire object. When
P 1 is located right over the viewer [when it is moved to (0 , 1 ,
3)], its projection is
undefined, and when it is moved farther to the left, its projection becomes negative. In
such a case, those parts of the object that are in front of the viewer are projected right
side up but distorted, and those parts that are behind the viewer are projected upside
down.
y
y
P 2
z
×
P 1
P 2
P 1
×
x
z
5
3
1
1
(a)
(b)
Figure 3.26: Perspective Projection with Negative z Coordinates.
3.5 General Perspective
The standard position is just a special case of perspective projection. It simplifies the
computations of the projected points and should be used whenever possible. There are
cases, however, where the viewer has to be positioned at different points and has to
look in different directions. A common example is computer animation. In a typical
animation sequence, there is an object or a scene and we imagine a camera moving
around or above the scene, taking snapshots much like a real movie camera. While the
camera is moving, the object or objects in the scene may also move along a path, rotate,
shrink, or become distorted by shearing.
An animation sequence is therefore done in steps, where each step starts by moving,
rotating, or otherwise transforming the object (if necessary), moving the camera (which
becomes the viewer) to its appropriate position for the step, orienting it, so it looks in
Search WWH ::




Custom Search