Interactive Ray Tracer
Ray Tracing defined
Ray Tracing is a very popular algorithm in computer graphics used for
creating realistic pictures of scenes that have a defined 3D structure.
A multitude of imaginary rays are sent from the viewer through the screen and
into the 3D geometry. If a particular ray hits some object, the "imprint"
of that object will appear on the screen at the place where the ray
intersected it.
Using the Interactive Ray Tracer
24-bit color mode
First, make sure your monitor is in 24-bit color mode. The pictures will
look really bad if you only have 8 bits of color (that is, 256 colors).
You can usually adjust your color mode on PCs and Macs.
Gamma Correction
Second, set the appropriate gamma constant for your monitor by clicking
on "gamma ??" and finding the right value. If you don't know your
monitor's gamma, you can just "look it up" using Greg Ward's handy chart
(see this
or
this
for details).
Modeling
Next, you are ready to set up your scene in the center window of the
applet. As a default you are given a ground plane (really, a stretched
out box) and one light (it's out of your field of view now). You can add
boxes and lights and move them around with the mouse using radio buttons at
the button of the applet. You can also stretch and squish the boxes and
move your view point too. You can also set the color and surface for
each box and also set color for each light. Use the select command to
cycle through the objects.
Or you can just load a predefined scene by hitting the "DEMO" button.
The is a sample output produced by my tracer for the DEMO:
Ray Tracing
Just hit the "TRACE" button and watch it go. The image will first be
drawn in very course grain and then incrementally refined with each pass.
Hit "STOP" at any time to go back to modeling.
Technical Notes
Since this ray tracer has been written in Java and is meant for the
broad Internet audience with short attention span, substance has been
somewhat sacrificed for form. In particular, the user does not have
control over many fine aspects of the ray tracer. On the other hand,
the friendly GUI allows for complex scene creation in under a minute.
Some features of this ray tracer:
- axis-aligned boxes with color and surface properties
- multiple movable colored light sources
- Phong lighting model
- physics-based geometry manipulation
- shadows
- mirrors
- iterative sampling
- Easy-to-use GUI
Credits
The Interactive Ray Tracer was written in Java by
Alyosha Efros
as a class project in CS 433 (Spring 1997) at the
University of Utah tought by
Pete Shirley.