Game Development Reference
In-Depth Information
winRes refers to the resolution of the window, in pixels,
pixPhys refers to the physical dimensions of a pixel,
devPhys refers to the physical dimensions of the output device. Re-
member that we usually don't know the individual sizes, but we do
know the ratio,
devRes refers to the resolution of the output device.
Many rendering packages allow you to specify only one field of view
angle (or zoom value). When you do this, they automatically compute the
other value for you, assuming you want uniform display proportions. For
example, you may specify the horizontal field of view, and they compute
the vertical field of view for you.
Now that we know how to describe zoom in a manner suitable for con-
sumption by a computer, what do we do with these zoom values? They go
into the clip matrix, which is described in Section 10.3.4.
10.2.5 Orthographic Projection
The discussion so far has centered on perspective projection, which is the
most commonly used type of projection, since that's how our eyes perceive
the world. However, in many situations orthographic projection is also use-
ful. We introduced orthographic projection in Section 5.3; to briefly review,
in orthographic projection, the lines of projection (the lines that connect
all the points in space that project onto the same screen coordinates) are
parallel, rather than intersecting at a single point. There is no perspective
foreshortening in orthographic projection; an object will appear the same
size on the screen no matter how far away it is, and moving the camera
forward or backward along the viewing direction has no apparent effect so
long as the objects remain in front of the near clip plane.
Figure 10.6 shows a scene rendered from the same position and orien-
tation, comparing perspective and orthographic projection. On the left,
notice that with perspective projection, parallel lines do not remain par-
allel, and the closer grid squares are larger than the ones in the distance.
Under orthographic projection, the grid squares are all the same size and
the grid lines remain parallel.
Orthographic views are very useful for “schematic” views and other
situations where distances and angles need to be measured precisely. Every
modeling tool will support such a view. In a video game, you might use an
orthographic view to render a map or some other HUD element.
For an orthographic projection, it makes no sense to speak of the “field
of view” as an angle, since the view frustum is shaped like a box, not a
pyramid. Rather than defining the x and y dimensions of the view frustum
Search WWH ::




Custom Search