Ray Tracing, Version 4.0
Day #9

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, the plane and the square may be textured with a 2D image.
    • the image is defined in a ppm formatted file
  • 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

Ray Tracing Tools:

Add these new classes and test each:

The code for readPPMfile is found in our files directory.
      

 

Make these changes:

Scene:

Test Files:

All files are located in /classes/cs3114/Advanced_Graphics/files/texture directory. The ones I used in class today for demo are there, along with the appropriate PPM files: