Ray Tracing, Version 2.2

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

  • the only attribute of the generic sphere is an assigned (emissive) color
  • 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:

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>.

void translate(GLdouble translate_x, GLdouble translate_y, GLdouble translate_z); which changes the object's current transformation matrix to indicate the primitive has been translated by (translate_x, translate_y, translate_z).

 

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

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

 

Test File:
/classes/cs3114/RayTracing/Projects/Scenes/2spheres.scn is a good one to test. It only has two generic spheres, one of which has been translated. The rendered scene is in Blackboard->Gallery

/classes/cs3114/RayTracing/Projects/Scenes/jack.scn is a another good one to test. It uses generic spheres which have been translated, scaled, and rotated. The rendered scene is in Blackboard->Gallery