A SERVICE OF

logo

100
Chapter 9: Viewing the Scene
Figure 9-3 Changing the Window Without Changing the Images Aspect
It is important, therefore, to change the aspect of the image if the window is revised. To
do that, you use csWindow, as explained in Chapter 12, User Interface Mechanisms.
The aspect ratio can be set through methods of csOrthoCamera and csPerspCamera.
The following methods set the position and orientation of a camera.
void setPosition(const csVec3f& position);
void setPosition(csFloat v0, csFloat v1, csFloat v2);
void setOrientation(const csRotation& orientation);
void setOrientation(csFloat v0, csFloat v1, csFloat v2, csFloat v3);
There is a corresponding get...() eld for each set...() eld.
You use the setPosition() methods to locate the camera in the scene. Initially, it is pointing
along the Z axis. To rotate the camera use the setOrientation() eld. You set the near and
far clip planes using the setNear() and setFar() methods.