Notes for Homework 9
- For this assignment, you may either write your own ray tracer from scratch or use a basic C++
ray tracing infrastructure that I have created.
- If you write your own code:
- You must include in your README how to recreate the sample scene (see below) with your program.
- Your output image should be 512 x 512.
- You may use the code to read and write PPM and BMP files from
here.
- You may wish to look at last year's homework 9 for a few hints on how to structure
your code.
- You may selectively use parts of my ray tracing framework.
- If you wish to use my framework:
- On Linux, grab this [tar.gz] file.
- Once you have completed the code, you should be able to type "make" to compile.
- On Windows, grab this [zip] file.
- Included is a Visual Studio.NET 2003 project (which should work in VS 2005, too).
- The framework uses GLUT (to display), so you need to have that installed.
- You should read through the code (at least the .h files) so you understand them.
- You need to write the following methods in order to complete/compile the code:
- In Camera.cpp: Camera::Camera()
- In Camera.cpp: Camera::GenerateRay()
- In InfinitePlane.cpp: InfinitePlane::Intersect()
- In InfinitePlane.cpp: InfinitePlane::ComputeNormal()
- In LambertianMaterial.cpp: LambertianMaterial::Shade()
- In Sphere.cpp: Sphere::Intersect()
- In Sphere.cpp: Sphere::ComputeNormal()
- I have created a function SetupHomework9Scene() in SetupScene.cpp that creates a Scene object
describing the required scene for you.
- You scene should draw the following REQUIRED scene:
- Eye at: (0,5,5), Looking at: (0,0,0), with Up Vector: (0,1,0).
- Field of view in the Y-axis should be 60 degrees.
- Red (1,0,0) sphere centered at (0,1,0) with radius 1
- Green (0,1,0) sphere centered at (3,1,-3) with radius 3
- Yellow (1,1,0) sphere centered at (-2,-3,2) with radius 2
- Blue (0,0,1) plane with normal (0,1,0) running through point (0,-2,0)
- Yellow (1,1,0) plane with normal (0,0,1) running through point (0,0,-7)
- Light at: (-5,5,2) with color (1, 0.6, 1)
- Here's an example result at 400 x 400.
- You may download an example executable:
- Linux (runs on MLH 301 lab machines)
- Windows (requires a copy of glut32.dll)
- Please update your web page with images of the sample scene, as well as a couple other scenes you've created.
Last Modified: Friday, October 27, 2006
Chris Wyman (cwyman@cs.uiowa.edu)