i
i
i
i
i
i
i
i
2.3. The Geometry Stage 19
The view volume of orthographic viewing is normally a rectangular
box, and the orthographic projection transforms this view volume into
the unit cube. The main characteristic of orthographic projection is that
parallel lines remain parallel after the transform. This transformation is a
combination of a translation and a scaling.
The perspective projection is a bit more complex. In this type of projec-
tion, the farther away an object lies from the camera, the smaller it appears
after projection. In addition, parallel lines may converge at the horizon.
The perspective transform thus mimics the way we perceive objects’ size.
Geometrically, the view volume, called a frustum, is a truncated pyramid
with rectangular base. The frustum is transformed into the unit cube as
well. Both orthographic and perspective transforms can be constructed
with 4 ×4 matrices (see Chapter 4), and after either transform, the models
are said to be in normalized device coordinates.
Although these matrices transform one volume into another, they are
called projections because after display, the z-coordinate is not stored in
the image generated.
5
In this way, the models are projected from three to
two dimensions.
2.3.4 Clipping
Only the primitives wholly or partially inside the view volume need to be
passed on to the rasterizer stage, which then draws them on the screen. A
primitive that lies totally inside the view volume will be passed on to the
next stage as is. Primitives entirely outside the view volume are not passed
on further, since they are not rendered. It is the primitives that are par-
tially inside the view volume that require clipping. For example, a line that
has one vertex outside and one inside the view volume should be clipped
against the view volume, so that the vertex that is outside is replaced by
a new vertex that is located at the intersection between the line and the
view volume. The use of a projection matrix means that the transformed
primitives are clipped against the unit cube. The advantage of performing
the view transformation and projection before clipping is that it makes the
clipping problem consistent; primitives are always clipped against the unit
cube. The clipping process is depicted in Figure 2.6. In addition to the six
clipping planes of the view volume, the user can define additional clipping
planes to visibly chop objects. An image showing this type of visualization,
called sectioning, is shown in Figure 14.1 on page 646. Unlike the previous
geometry stages, which are typically performed by programmable process-
ing units, the clipping stage (as well as the subsequent screen mapping
stage) is usually processed by fixed-operation hardware.
5
Rather, the z-coordinate is stored in a Z-buffer. See Section 2.4.