i
i
i
i
i
i
i
i
4.6. Projections 89
4.6 Projections
Before one can actually render a scene, all relevant objects in the scene must
be projected onto some kind of plane or into some kind of simple volume.
After that, clipping and rendering are performed (see Section 2.3).
The transforms seen so far in this chapter have left the fourth com-
ponent, the w-component, unaffected. That is, points and vectors have
retained their types after the transform. Also, the bottom row in the 4 ×4
matrices has always been (0 0 0 1). Perspective projection matrices are
exceptions to both of these properties: The bottom row contains vector
and point manipulating numbers, and the homogenization process is often
needed (i.e., w is often not 1, so a division by w is needed to obtain the
nonhomogeneous point). Orthographic projection, which is dealt with first
in this section, is a simpler kind of projection that is also commonly used.
It does not affect the w component.
In this section, it is assumed that the viewer is looking along the nega-
tive z-axis, with the y-axis pointing up and the x-axis to the right. This is
a right-handed coordinate system. Some texts and software, e.g., DirectX,
use a left-handed system in which the viewer looks along the positive z-
axis. Both systems are equally valid, and in the end, the same effect is
achieved.
4.6.1 Orthographic Projection
A characteristic of an orthographic projection is that parallel lines remain
parallel after the projection. Matrix P
o
, shown below, is a simple ortho-
graphic projection matrix that leaves the x-andy-components of a point
unchanged, while setting the z-component to zero, i.e., it orthographically
projects onto the plane z =0:
P
o
=
⎛
⎜
⎜
⎝
1000
0100
0000
0001
⎞
⎟
⎟
⎠
. (4.59)
The effect of this projection is illustrated in Figure 4.16. Clearly, P
o
is
non-invertible, since its determinant |P
o
| = 0. In other words, the trans-
form drops from three to two dimensions, and there is no way to retrieve
the dropped dimension. A problem with using this kind of orthographic
projection for viewing is that it projects both points with positive and
points with negative z-values onto the projection plane. It is usually use-
ful to restrict the z-values (and the x-andy-values) to a certain interval,