Game Development Reference
In-Depth Information
Direct3D handles the viewport transformation for us automatically, but
for reference the viewport transformation is described with the follow-
ing matrix. The variables are the same as described from the
D3DVIEWPORT9 structure.
Width
0
0
0
2
Height
0
0
0
2
0
0
MaxZ
MinZ
0
Width
Height
X
Y
MinZ
1
2
2
2.3.9 Rasterization
After the vertices are transformed to screen coordinates, we have a list
of 2D triangles. The rasterization stage is responsible for computing
the individual pixel color values needed to draw each triangle (see Fig-
ure 2.17).
Figure 2.17: A screen triangle
being rasterized
The rasterization process is very intensive computationally and should
always done by dedicated graphics hardware. The end result of the
rasterization stage is the 2D image that is displayed by the monitor.
2.4 Summary
3D objects are represented as triangle meshes—a list of triangles
that approximates the shape and contours of the object.
The virtual camera is modeled as a frustum. The volume of space
inside the frustum is what the camera “sees.”
3D objects are defined in local space and are then all brought into
one world space system. To facilitate projection, culling, and other
operations, the objects are then transformed to view space, where
the camera is positioned at the origin and looking down the positive
Search WWH ::




Custom Search