Ray Tracing, Version 3.0

Goal: Ray trace a scene where

  • the only objects in the scene are generic spheres, 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
  • 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

Directory:

Ray Tracing Tools:

  Vector operator + (GLdoubleVector other);// which returns the sum of this vector and other vector

class Light
{

  public:

//methods:
Constructor, which initializes values

//data:
Color3 ambient, diffuse, specular;
Point pos; //position of light

}

class Material
{

  public:

//methods:
Constructor, which initializes values
void set(Material source);

//data:
Color3 ambient, diffuse, specular, emissive;
float specularExponent;

}

Scene Tools:

Test File:

/classes/cs3114/RayTracing/Projects/Scenes/lighted_sphere.scn is a good one to test. It only has one generic sphere and one light. The rendered scene is in Blackboard->Gallery

Working Directory:

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

Submit:

Submit all files to directory v3