Game Development Reference
nical terms). The following diagram is an example of a camera frustum, where FOV
stands for field of view :
The gluLookAt function multiplies the currently selected matrix by a view matrix
generated from nine double s (essentially three vectors), which represents the eye
position, the point at which the camera is looking at, and a vector that represents
which direction is up. The up vector is used to assist in defining the camera's rotation.
To use common angular rotation vernacular, if we only define a position and target,
that gives us the pitch and yaw we need, but there's still the question of the roll, so
we use the up vector to help us calculate it.
Finally, glViewport () is used to describe the current Viewport , or where we
should draw the current camera's view of the scene in the application window. Typ-
ically, this would stretch to the bounds of the window from 0 , 0 to w, h (where w and