Game Development Reference
In-Depth Information
of pixels in the x and y dimensions. For example, a resolution of 1280×720
means that devRes x = 1280 and devRes y = 720.
But, as mentioned already, we often deal with square pixels with an
aspect ratio of 1:1. For example, on a desktop monitor with a physical
width:height ratio of 4:3, some common resolutions resulting in square pixel
ratios are 640 × 480, 800 × 600, 1024 × 768, and 1600 × 1200. On 16:9
monitors, common resolutions are 1280×720, 1600×900, 1920×1080. The
aspect ratio 8:5 (more commonly known as 16:10) is also very common, for
desktop monitor sizes and televisions. Some common display resolutions
that are 16:10 are 1153 × 720, 1280 × 800, 1440 × 900, 1680 × 1050, and
1920×1200. In fact, on the PC, it's common to just assume a 1:1 pixel ratio,
since obtaining the dimensions of the display device might be impossible.
Console games have it easier in this respect.
Notice that nowhere in these calculations is the size or location of the
window used; the location and size of the rendering window has no bearing
on the physical proportions of a pixel. However, the size of the window
will become important when we discuss field of view in Section 10.2.4, and
the position is important when we map from camera space to screen space
Section 10.3.5.
At this point, some readers may be wondering how this discussion makes
sense in the context of rendering to a bitmap, where the word “physical”
implied by the variable names pixPhys and devPhys doesn't apply. In most
of these situations, it's appropriate simply to act as if the pixel aspect ratio
is 1:1. In some special circumstances, however, you may wish to render
anamorphically, producing a squashed image in the bitmap that will later
be stretched out when the bitmap is used.
10.2.3 The View Frustum
The view frustum is the volume of space that is potentially visible to the
camera. It is shaped like a pyramid with the tip snipped off. An example
of a view frustum is shown in Figure 10.3.
The view frustum is bounded by six planes, known as the clip planes.
The first four of the planes form the sides of the pyramid and are called
the top, left, bottom, and right planes, for obvious reasons. They corre-
spond to the sides of the output window. The near and far clip planes,
which correspond to certain camera-space values of z, require a bit more
explanation.
The reason for the far clip plane is perhaps easier to understand. It
prevents rendering of objects beyond a certain distance. There are two
practical reasons why a far clip plane is needed. The first is relatively easy
to understand: a far clip plane can limit the number of objects that need
to be rendered in an outdoor environment. The second reason is slightly
 
Search WWH ::




Custom Search