Additional documentation
for Ray Trace software package, release 2.0β
(beta).
Author: Sam Buss
Univ. of California, San Diego
This RayTrace software package accompanies my book 3D Computer Graphics: A Mathematical
Introduction with OpenGL (Cambridge University Press, 2003), but
can also be used independently. Documentation for release 1.0 is in the
appendix of the above-mentioned book, but you also need to read the source code
to learn the rest of its functionality.
The new items in Release 2.0β include the following:
- There are only minor changes in functionality, and release 2.0 is mostly
compatible with release 1.0. Some of the "Get" routines have been
changed, for instance. A lot of new routines have been added.
Most prior users will have no incompatibilities.
- A number of bugs have been fixed. This includes a problem with
repeating textures, a problem with bump mapping the back faces (or, inside
faces) of objects.
- OpenGL rendering mode has been added to the main programs
RayTrace.cpp and RayTrace2.cpp. When the program starts
up, it renders first in OpenGL using GLUT. Texture maps and other
advanced features are not supported, and the lighting will likely look
terrible, but it lets you resize the window and change the view point, etc.,
without long waits for the ray tracing to occur.
New commands: "g" or space bar starts the ray tracing.
After it is done, hit "G" to show the OpenGL again. Use arrow keys to
change the view point. Use the HOME and END keys to change the distance of the
viewer from the scene. Resizing the window or giving any command that
changes the view puts it program back to using GLUT to render the scene.
Internally, the OpenGL rendering mode is handled by the new
OpenglRender project. If you want to learn how to call the
routines in this project, examine their use in RayTrace.cpp and RayTrace2.cpp.
- TransformViewable. New methods for transforming viewable
objects by a rigid map.
- CalcBoundingPlanes. This new method has been added to all
viewable objects. You pass in a unit vector normal to a plane, and the
routine calculates the minimum and maximum plane coefficients on two planes
that bound on the object from both sides. The minimum is at most the
minimum value of the normal vector dot-product with any point on the Viewable
object. The maximum likewise is at least as large as the maximum vlaue
of the norm vector for-product with any such point.
CalcBoundingPlanes is meant for advanced users who want to write
bounded box hierarchies, BSP
structures or other spatial data structure to speed up the ray tracing software
(no software of this kind is provided at present).