OpenGL/GLUT-based Viewer
Kenneth E. Hoff III
last updated 08/06/98
The viewer provides a simple framework upon which to build OpenGL-based
applications. It supports the following features:
-
Various modes of world navigation, including trackball, drive, translate,
and look.
-
Solid, wireframe, and point toggling
-
Window frame-grabbing to PPM files - "snapshot"
-
Camera path recording and playback (with timing information)
-
User provided display routine that can be called continuously for animation
(as idle routine)
-
Backface culling toggling
-
Complete inertial navigation system that allows users to impart "momentum"
on an object being viewed. This option can be toggled.
-
Flat/Smooth Shading toggling
-
Supports four cameras. We can toggle between cameras and each camera's
frustum can be displayed.
-
Text display (module is provided, but is not used), just call routines
at the end of the display routine to have text in the viewer (see viewer/text.hpp,text.cpp).
-
Runs on SGIs and on the PC without changing any code.
Two sample programs illustrate how to use the viewer:
To use the viewer, the following is required:
-
viewer: OpenGL viewer that provides
a framework upon which to build OpenGL-based applications.
-
camera: a fully-featured camera class
module that provides storage of projection and viewing parameters (the
orientation axes and the frustum), provides a direct link to the OpenGL
matrix stack by directly providing GL_MODELVIEW and GL_PROJECTION matrices
so users can simply manipulate the camera as an object and then load the
matrices before rendering, transformation matrices can be provided that
go between screen-space and object-space, basic world-navigation routines
are provided, etc.
-
math: various math modules providing
for vectors, matrices, and planes.
To run the viewer:
-
SGI: use the provided makefile.
It will need editing to provide the relative location of the camera and
the vec3f files, and the location of the GLUT library and include files.
-
PC: (assuming MSVC) create a Win32 console application, add the
OpenGL and GLUT libraries, add all source files, compile, and run. OpenGL
and GLUT must be properly installed.
Screen snapshot of viewer_example1:
