Theory






Outlined below is the theory behind the viewing system used in the Camera and Perspective Transforms.

World CoordinateSpace
The object in the World Coordinate space is represented in a .obj file as a set of vertices and a set of face list. The object is displayed as a Wireframe Model. The Viewing Frustrum in the World Coordinate Space is displayed using Inverse Camera transforms. The inverse transformation used is defined below.



View Coordinate Space
To calculate the viewing transforamtion that transforms the object from the world space to the view space the following parameters ar required. These parameters are defined in the World Coordinate Space.
The transformation from world coordinate to view coordiante space is carried out using the Tview matrix.




The Viewing Frustrum is displayed in the view space using the Near Plane distance, the far plane distance and the Screen height. The View Plane is coincident with the Near Plane. The view volume is a truncated pyramid in the view space against which we clip the object. The view volume is defined by six planes



The View Window is square as specified by the Screen Height and symmetrically disposed about the "center" of the view plane.

Screen Coordinate Space
The Perspective Projection that is used to trnasform the object from View space to Screen space is as follows.



The View Window in the Screen Space is drawn with values of X and Y ranging from [-1 1] and in the range of [0 1] for the Z axis.

Clipping
Clipping is carried out in the view space. The object is clipped against the six planes of the view volume using Cohen-Sutherland Line Clipping Algorithm.