Project 2: Getting Started
You should use the code available at /cs/cs155/proj2/src, on the
graphics machines, as a starting point for your assignment. We provide
you with the following files. Files in bold are the ones you'll proabably
want to modify.
UML describing the classes can be found here.
-
camera.[cpp/h]: camera object handles movement commands, sets up OpenGL
matrices, viewpoint for raytracing.
-
common.h: useful definitions and a few common includes
-
control.[cpp/h]: handles OpenGL menu, mouse and keyboard input
-
directionallight.[cpp/h]: directional light object, inherits from
Light.
-
geometry.[icc/h]: geometry library code, with Point, Vector, Color,
TexCoord, Matrix, and Ray template classes, along with typedefs for common
instances of each (eg. a Point3d is a three dimensional point storing
doubles)
-
group.[cpp/h]: object to group multiple shapegroups together and
apply a local transformation. inherits from ShapeGroup.
-
image.[cpp/h]: image class, supports reading and writing PPMs and BMPs, as
well as a variety of OpenGL calls. Same as from project 1.
-
intersection.h: intersection structure to store all the relevant
information about a ray-shape intersection.
-
light.[cpp/h]: abstract light class which provides the basic interface for
all the supported light types
-
macro.[cpp/h]: macro class for pasting multiple instances of some geometry
in the scene hierarchy.
-
macroinstance.[cpp/h]: an instance of a macro, pasted into the scene
hierarchy. inherits from ShapeGroup.
-
main.[cpp/h]: sets up the OpenGL context and handles displaying and
resizing the image window. Also handles non-interactive mode
-
material.[cpp/h]: class to store all relevant material properties
about a surface. Features like texture mapping will involve this class.
-
parse.[cpp/h]: utility functions to handle reading text while ignoring
comments and flag parsing.
-
pointlight.[cpp/h]: point light object, inherits from Light.
-
rayfile.[cpp/h]: top-level class that stores the entire RAY structure,
including the scene hierarchy, and prefoms raytracing.
-
rayfile_render.cpp: two functions are defined here -
RayFile::raytrace() and RayFlile::getColor(). This is where most of your
initial work needs to be done.
-
rayfileinstance.[cpp/h]: class to handle importing and pasting the
contents of one rayfile into another. Inherits from ShapeGroup.
-
roots.[cpp/h]: utility second, third and fourth order polynomial root
finding functions. Useful for intersection testing.
-
rt.[dsp/dsw]: Visual C++ 6.0 project and workspace files, if you'd rather
do the project on a windows box. Remember though that your final code
will be graded on the graphics machines.
-
shape.[cpp/h]: abstract Shape class to unify the interface for the
supported primitives. Inherits from ShapeGroup.
-
shapegroup.[cpp/h]: abstract ShapeGroup class that unifies the interfaces
of shapes and groups of shapes, allowing the scene hierarchy to be
recursively defined.
-
sphere.[cpp/h]: class representing a sphere primitive in the scene
hierarchy. Inherits from Shape.
-
spotlight.[cpp/h]: spot light object, inherits from Light.
-
triangle.[cpp/h]: class representing a triangle primitive in the
scene hierarchy. Inherits from Shape.
-
win32.[cpp/h]: necessary code to keep the project running smoothly on
windows machines.
-
Makefile: GNU makefile with makedepend support
The Makefile supports a few operations...make will build
all necessary objects and the executable. make clean will
remove the executable and all object files. make depend will
create header dependency information. make fresh is the same
as make clean ; make depend ; make.
An explanation of some of the aspects
of the code that will not directly affect your implementation
(such as parsing or the OpenGL rendering) is given here. This information is not necessary for
any of the required functionality, but may become useful as you extend
your raytracer to do bigger and better things.
Links:
Last Update: 2/14/03