RenderWare V2.1

Previous Page Index Next Page

The Virtual Camera Model


The purpose of a camera is to project the objects in a 3D scene onto an image plane (or view plane), a rectangular region of which, called the view plane window (or view window), is output as a 2D image. The rectangular portion of the display surface onto which a camera’s view window is mapped is called the viewport. RenderWare supports both perspective and parallel projections.

Undisplayed Graphic

A camera can be positioned anywhere in world coordinate space and can be pointed in any direction.

Note that:

· The camera position is the origin of camera space. It is also the center of projection, except when the view offset has been specified. When a view offset is specified, the center of projection is moved parallel to the view plane, from the camera position.
· The Z axis of camera space (N) is defined by the camera’s "Look At" vector. This is normal to the view plane.
· The view plane is defined to be one unit away from the camera position, along the N axis.
· The viewing direction is defined by a vector from the center of projection to the center of the view plane.
· The camera or viewing coordinate system (VCS) is left-handed.
· The view up vector (V) specifies the "up" direction, i.e., where the top of the screen is. Together with N, it establishes the orientation of the camera and of the view plane window within the view plane. RenderWare refers to this vector as the "Look Up" vector.
· The U vector gives the direction of the positive X axis in the camera coordinate system. There is no need to explicitly set this parameter since RenderWare can compute U as the cross-product of V and N. RenderWare calls this the "Look Right" vector.
· The view window determines image content, i.e., the rectangular region of the view plane that appears in the image produced by the camera. It is centered about (0.0, 0.0, 1.0) in camera space.
· Changing the view window is analogous to changing the setting of a zoom lens in a real camera and can simulate the effects of wide angle or telephoto lenses (by specifying larger and smaller extents for the view window respectively). To get objects to appear in their "normal" size, the view window extent should be set to one. Increasing the size of the view window widens the field of view, which means that a larger proportion of the scene will appear in the image and therefore the objects in the scene appear smaller.
· The user can also change the position of the front (near) and back (far) clipping planes (both of which are coplanar with the view plane) by specifying a distance from the camera position. The near clipping plane must be at a distance greater than 0.025 units from the camera.