Ray Tracing, Version 4.6
Day #11

Goal: Ray trace a scene where

  • the only objects in the scene are generic spheres, planes, squares, tapered cylinders, and cubes.
  • the objects may have been translated, scaled, and/or rotated with respect to an axis
  • in addition to color, the attributes of each object may include material coefficients for diffuse, specular, ambient color
  • a positional light may be placed in the scene
  • in addition to material attributes,
    • all the objects may be textured with a 2D image
    • all the objects may be textured with a 3D generated texture, such as wood and marble
  • the images are defined in ppm formatted files
  • the light has a diffuse, specular, and ambient component
  • a value for global ambient light may be assigned
  • shadows are correctly rendered, including on textured surface
  • descriptions of the objects, lights, and camera, as well as the names of the image files, are read in from a file, using SDL
  • value for backgroundColor is now read in from the scene description file, using SDL

Although this is optional, it is highly recommended. Use as simple or as complex a texture function as you want. It is easiest to give a name to each function, and then change your readScene function to read in the idetifier (function name) and then, according to what it is, read in any parameters you want attached to that function. Check out the External Links page for ideas, actual code, etc.