Perspective Mode
In Perspective Mode, parallel lines are not really drawn parallel but
are drawn such that they appear to converge at some point on the horizon.
By using Perspective, scenes will look more realistic
since objects in the distance appear smaller than ones close to the
viewer even though they are defined to have the same dimensions.
In Orthographic Mode, however, parallel lines are always drawn parallel and
identical linear measures will always be drawn the same size regardless of
their distance from the viewer.
In OpenGL, some of the important Perspective commands are the following.
Read about them in more detail in your textbook, but here are a few we
will be emphasizing in this program:
- glMatrixMode(GL_PROJECTION)
Sets up the matrix that will
be used to appy to objects drawn in Perspective Mode
- gluPerspective(Angle, Aspect Ratio, Near Clipping, Far Clipping)
This determines how the window is viewed. The Angle, represented in degrees,
refers to the amount of the scene that the eye can actually view. The Aspect
Ratio is the ratio between width and height of the viewing field. The Near
Clipping Plane instructs the graphic engine to avoid drawing anything that
is closer than the indicated number. The Far Clipping Plane is similar in concept,
but instructs the program to avoid wasting time on anything that is farther
away than the specified number.
- gluLookAt(Eye_X, Eye_Y, Eye_Z, View_X, View_Y, View_Z,
Up_X, Up_Y, UpZ)
Determines how the user will be viewing the scene.
There are three coordinates for the position of the viewer's "Eye",
three for the center of the person's focus or "View", and three
to determine which way is "Up".