Ray Tracing, Version 1.5
Day #3

Goal: Ray trace a scene where

  • the entire scene is on the negative-z side of the world origin,
  • the only objects in the scene are spheres
  • the spheres are generic spheres which may have been translated, scaled, and/or rotated with respect to an axis
  • the only other attribute of each sphere is an assigned (emissive) color
  • the camera is set up on the positive z axis, looking toward the origin

Ray Tracing Tools:

Add the following methods to class Object and thoroughly test each:

void scale(GLdouble scale_x, GLdouble scale_y, GLdouble scale_z); which changes the object's current transformation matrix to indicate the primitive has been scaled by (scale_x, scale_y, scale_z).

void rotate(GLdouble degrees, GLdouble x, GLdouble y, GLdouble z); which changes the object's current transformation matrix to indicate the primitive has been rotated CCW through an angle of "degrees" about the axis given by <x, y, z>.

 

Add the following methods to class GLdoubleVector and thoroughly test each:

GLdoubleVector cross(GLdoubleVector other); which returns the cross product of this vector with other vector.

void normalize(); which normalizes this vector (makes it have unit length.)

Driver Program:

Copy your driver program rt_1.cpp to rt_1.5.cpp. Instead of the two spheres defined in the program, define these spheres (inside the function defineSpheres):

Begin Working On Version 2.0:

Then we will need to put in informations about the camera: