This sample demonstrates how
to perform view frustum culling, which is
a very clever way of using bounding volumes
to skip the rending of objects which are
outside the current view. It's a fairly
straight forward concept: extract the clip
planes that define the view's frustum from
the scene's model-view-projection matrix
and use them to see whether the bound spheres
that represent our 3D objects are in or
out of the frustum. If the object is outside
the frustum, we do nothing and skip it.
If it proves to be inside or intersecting
the frustum, we render it. This is widely
used optimization in simulations and games
and every 3D graphics programmer should
be aware of it.
Relevant Keywords: glMatrixMode, glLoadIdentity,
glScalef, glRotatef, glTranslatef, glPushAttrib,
glPopAttrib, glLoadIdentity, glRasterPos2f,
glutBitmapCharacter, glGetFloatv, glutGet,
GLUT_BITMAP_HELVETICA_12, and GLUT_ELAPSED_TIME.