csOrthoCamera
101
csOrthoCamera
csOrthoCamera defines an orthographic projection. An orthographic projection uses a
parallelepiped (box) frustum. Unlike the frustum in Figure 9-2, the size of the frustum
does not change from one end to the other. For this reason, the distance from the camera
to an object in the frustum does not affect the size of the object.
You use this type of camera when you do not want to view objects in perspective. For
example, when you create architectural blueprints and CAD models, it is important to
maintain the actual sizes of objects and angles between them when they are projected.
csOrthoCamera uses the following methods to define the viewing frustum:
void setWidth(csfloat width)
void setHeight(csfloat height)
void setCenter(const csVec2f* center)
void setCenter(csFloat v0, csFloat v1);
void setNearClip(csFloat nearClip);
void setFarClip(csFloat farClip);
There is a corresponding get...() field for each set...() field.
The width and height methods define the left, right, top, and bottom of the
parallelepiped (box) frustum. The setCenter() method points the csOrthoCamera at the
center of the scene you want to view.
csPerspCamera
A csPerspCamera creates a perspective view in which objects closer to the camera appear
larger than the same-sized objects located further from the camera. This type of camera
imitates normal vision. For example, train tracks and the distance between them appear
smaller the more distant they are.
You can understand why more distant objects appear smaller by looking at Figure 9-4.