Graphics Reference
In-Depth Information
Up direction
Look direction
v
Height
Position
n
f
Figure 13.22: The specification of an orthographic camera.
think of a parallel projection as a kind of limit of these perspective projections as
the eyepoint moves to infinity. An orthographic projection is one in which the
parallel lines along which we project are all orthogonal to the film plane. It may
seem surprising that you'd ever want the projection lines to not be orthogonal to
the film plane, but many mechanical drawings are produced this way. This chap-
ter's online materials describe this in some detail. We'll discuss only orthographic
cameras here.
An orthographic camera is an abstraction and does not correspond to any phys-
ical camera. Figure 13.22 shows how the parts of an orthographic camera are
labeled, which corresponds closely to the labeling for a perspective camera. The
key distinction is that the “Position” for an orthographic camera does not repre-
sent the eyepoint, but rather an arbitrary location in space relative to which we
can define the other parts of the camera. The other distinction is that rather than
having horizontal and vertical field-of-view angles, we have a width and a height.
For an orthographic camera, we transform directly from the camera's view
volume to the standard parallel view volume; the critical step in the construction is
1
2
3
Transform3 t = Transform3.PointAndVectorsToPointAndVectors(
P-n * w, (width/2.0) * u, (height/2.0) * v, (n - f) * w,
Point3(0,0,0), Vector3(1,0,0), Vector3(0,1,0), Vector3(0,0,1));
where we've used the points-and-vectors form this time, just to show how it can be
done. We leave it to you to verify that we have specified the correct transformation.
Inline Exercise 13.8: Rewrite the code for the camera transformation using
the points-to-points version.
13.8.1 Aspect Ratio and Field of View
Suppose you want to display a 200
400 image on-screen, a rendering of some
virtual world. You need to define a perspective or parallel camera to make that
view. Let's work with the somewhat simpler parallel case. It's clear that your par-
allel camera should have its width set to be twice its height. If you set the width
×
 
 
 
Search WWH ::




Custom Search