3D Engine Documentation


Installation and Usage
Install
There's not much as far as installation, but here are simple instructions on how to decompress and build the software, assuming you have a tarball.

Usage
Here is how to run the default cave application, including its various runtime commands.
Proprietary File Formats
Cave(.cave) File Format

OBJ Extended 3D File Format

Scene(.sce) File Format


Diagrams
Class & Structure Requirements
Classes are circled. Structures are squared. Arrows denote which class/struct each class/struct requires.
Classes
Cave Object Class (cave.hcave.cpp)
Class cave_object stores cave attributes and provides methods to read cave files, and to update, draw, and test a cave.

Image Class (image.himage.cpp)
Class image stores an image and provides methods for reading, writing, and manipulating images.

Light Class (light.h)
Class light stores light attributes including position/direction and colors and provides a method to enable a light.

Model Class (model.hmodel.cpp)
Class model reads and writes OBJ-like files, and provides methods used to display models.

Scene Class (scene.hscene.cpp)
Class scene encapsulates a lot of 3Dengine data, and provides a method for reading scene files. A method for writing scene files will be added at some point.

Singly-linked List Class (sllist.h)
Template class sllist provides dynamic storage for any type of elements.

Terrain Class (terrain.hterrain.cpp)
Class terrain provides methods to read a grayscale image and display it as a terrain by interpreting it as a heightmap.

Texture Class (texture.htexture.cpp)
Class texture provides a method for reading an image and storing it in a new 2D texture object.

Length 3 Vector Class (vect.h)
Template class vect<> provides logical, arithmetic, and assignment operations, as well as other vector math functions for manipulating vectors consisting of three floating point elements.
Structures
Camera Structure (camera.h)
Structure camera stores location and orientation of a viewer, as well as field-of-view and clipping attributes which define a viewing frustum.

Fog State Structure (fog.h)
Structure fog_state stores parameters of distance, density, function, and color of fog.

Window Structure (window.h)
Structure window stores position and size of a window/viewport, the window's ID number, and a bit mask specifying it's display mode.
Miscellaneous
Color Type & Definitions (colors.h)
Define type Color and standard color constants.

GLUT Environment (env_glut.henv_glut.cpp)
This is an effort to abstract GLUT calls out of the main application code.

OpenGL Error Checking (errorcheck.herrorcheck.cpp)
If OpenGL has thrown an error, errorcheck prints the error code and optional message, then exits the program.

Trigonometric Approximations (trig_approximations.htrig_approximations.cpp)
These functions provide fast access to approximations of the desired trigonometric values.