Graphics Reference
In-Depth Information
Figure 8.5. The view frustum as seen in world space, and how it maps to the unit cube.
the x- and y -directions, and from 0 to 1 in the z -direction. In essence, the eight corners of
the viewing frustum are mapped to the eight corners of the unit cube. This means that if
an object is within the viewing frustum in view space, it will end up inside the unit cube
after projection and w -divide. Figure 8.5 demonstrates a view frustum being converted to
clip space.
The projection process is accomplished through a single projection matrix. A typical
projection matrix formula is shown in Equation (8.7), which is also implemented in the
D3DXMatrixPerspectiveFovLH() C++ function:
(8.7)
The three different transformation matrices we have discussed up to this point—the
world, view, and projection matrices—can also be concatenated into a single complete
transform matrix. When they are used to render a large number of vertices (as we will be
doing), applying a single matrix instead of individually multiplying each matrix on its own
will provide a significant performance benefit by reducing the number of calculations per-
formed, while still producing the same result.
Search WWH ::




Custom Search