Ray Tracing, Version 2.0

Goal: Ray trace a scene where

  • the only object in the scene is the generic sphere
  • 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 <0,1,0>.

  • 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:

Scene Tools:

Suggestion:

Add a class, Scene, which is defined in /classes/cs3114/RayTracing/Projects/scene_tools.h

The header file for the class has been started for you. Just implement the methods, according to the pre- and post-conditions. (Some of the methods you have previously implemented, local to your driver program.) Be sure to test the methods before using them. The methods include:

  • readScene -- first version is found in /classes/cs3114/RayTracing/Projects/scene_tools.cpp. Feel free to copy and paste, or write your own.
  • shadePixel
  • rayTracer
  • getFirstHit
  • shader
  • setup

Ray Tracing Tools:

Suggestion: Add the following classes to ray_tracing_tools:

Test Scene: /classes/cs3114/RayTracing/Projects/Scenes/red_sphere.scn

- this should produce the same image as version 1.x

Driver Program:

Makefile:

Be sure to change your makefile to account for scene_tools.h and scene_tools.cpp.

Working Directory:

Make a subdirectory v2.0 in your Working Directory. When you have version 2.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 v2