Graphics Reference
In-Depth Information
space and j is the half angle of view in the vertical or horizontal direction (assuming a square viewport
for now and, therefore, the vertical and horizontal angles are equal). The z -coordinate is transformed
so that planarity is preserved and the visible range in z is mapped into [0,
1]. (These ranges are
arbitrary and can be set to anything by appropriately forming the perspective matrix. For example,
sometimes the visible range in z
þ
1].) In addition, the aspect ratio of the viewport
can be used in the matrix to modify the horizontal or vertical half angle of view so that no distortion
results in the viewed data.
is set to [
1,
þ
Perspective divide
Each point produced by the perspective matrix multiplication has a nonunitary fourth component that
represents the perspective divide by z . Dividing each point by its fourth component completes the per-
spective transformation. This is considered a separate step from the perspective matrix multiply
because a commonly used clipping procedure operates on the homogeneous representation of points
produced by the perspective matrix multiplication but before perspective divide.
Clipping, the process of removing data that are outside the view frustum, can be implemented in a
variety of ways. It is computationally simpler if clipping is performed after the world space to eye space
transformation. It is important to perform clipping in z using the near clipping distance before pers-
pective divide to prevent divide by zero and to avoid projecting objects behind the observer onto
the picture plane. However, the details of clipping are not relevant to the discussion here. Interested
readers should refer to one of the standard computer graphics texts (e.g., [ 2 ]) for the details of clipping
procedures.
Image to screen space mapping
The result of the perspective transformation (the perspective matrix multiply followed by perspective
divide) maps visible elements into the range of minus one to plus one ([
1]) in x and y . This
range is now mapped into the user-specified viewing area of the screen-based pixel coordinate system.
This is a simple linear transformation represented by a scale and a translation and thus can be easily
represented in a 4
1,
þ
4 transformation matrix.
2.1.8 Error considerations
Accumulated round-off error
Once the object space to world space transformation matrix has been formed for an object, the object is
transformed into world space by simply multiplying all of the object's object space points by the trans-
formation matrix. When an object's position and orientation are animated, its points will be repeatedly
transformed over time—as a function of time. One way to do this is to repeatedly modify the object's
world space points. However, incremental transformation of world space points can lead to the accu-
mulation of round-off errors. For this reason, it is almost always better to modify the transformation
from object to world space and reapply the transformation to the object space points rather than to
repeatedly transform the world space coordinates. To further transform an object that already has a
transformation matrix associated with it, one simply has to form a transformation matrix and premul-
tiply it by the existing transformation matrix to produce a new one. However, round-off errors can also
accumulate when one repeatedly modifies a transformation matrix. The best way is to build the trans-
formation matrix anew each time it is to be applied.
Search WWH ::




Custom Search