in driver program
in init()
- declare an object of type Scene
- have this Scene object call readScene( )
- have this Scene object call setUp( ), which
- assigns values to N and theta
- calculates values for
- H
- W
- vectors n, u, v
- normalizes vectors n, u, v
- assigns ray's start position to be eye's position
in display( )
- clears the screen
- calls rayTracer( )
- flushes the buffer
in scene_tools:
in rayTracer( )
for each row,
for each column,
- calculates ray's direction
- sets pixelColor to the value returned by shader( ), for this ray
- calls shadePixel(this_column, this_row, pixelColor)
in shader( )
- calls getFirstHit for this ray, which
for each Primitive in list of primitives in this scene,
- sets itRay to be the inverse transform of ray with this primitive, using the primitive's inverse transformation matrix, M.
- if this primitive is a sphere,
- declares