Ray Tracing, Version 3.2

Goal: Ray trace a scene where

  • the only objects in the scene are generic spheres and generic cubes, which may have been
    • scaled
    • translated
    • rotated with respected to an axis

  • in addition to color, the attributes of the generic sphere may include material values for diffuse, specular, ambient color
  • a positional light may be placed in the scene by specifying its position
  • the light has a diffuse, specular, and ambient component
  • a value for global ambient light may be assigned
  • shadows are correctly rendered
  • speedup: extents are used around each generic primitive (generic cube around the generic primitive is test first; if hit, then primitive is tested)
  • the camera is set up
    • at position (eyex, eyey, eyez),
    • looking at point (look_atx, look_aty, look_atz), with
    • the original up-direction for the camera being <upx, upy, upz>.

  • speed-up has been accomplished by more wisely computing the ray's direction, for each ray.
  • the scene (including camera information and sphere information) has been described in a file using Scene Description Language
Ray Tracing Tools:
  • Add a class for Cube, which is similar to the class for Sphere; it has only a constructor and a method to determine the hit times with the ray. Remember, this should return a boolean value. If the ray does hit the cube, it could have two hits times (entering and exiting) or one hit time (ray was inside the cube to begin with and is exiting.)

Scene Tools:

Test File:

Any of your previous scenes should work. Compare with earlier version to determine if speedup was realized.

Working Directory:

Make a subdirectory v3.2in your Working Directory. When you have version 3.2 working correctly, copy all files pertaining to it, including the makefile, to that directory and don't touch it!