Homework 5, due Wednesday, Oct 9.

Your assignment for next week is to extend your ray tracer in various ways. You can use the same framework that you used for the previous assignment. I'm going to give you free rein on this assignment, and I'd like you to be creative with it.

All the math that I went through in class is in the ray tracing class notes, which you might want to use for guidance.

Do as many of the following as you can:

  1. Objects which are boolean combinations of first and/or second degree surfaces (eg: a flying saucer by intersecting two spheres, a cylindrical can, a cube with a cylindrical hole cut out of it).

  2. Make things move. For example, as the observer drags the mouse, rotate the objects in the scene.

  3. More than one light source.

  4. Shadows: Trace a secondary ray to the light source, and see whether the ray hits anything. If it does, then don't apply the diffuse or specular shading from that light source.

  5. Reflections: Compute the reflection direction, and continue tracing the ray recursively. Hint: You can get really nice results if you combine this with use of the noise function.

As before, there are many other things you can do for extra credit in this assignment, and I'll be very open minded if you do something really cool. You get extra credit (and really cool results) if you use the noise function (source code is listed at http://mrl.nyu.edu/perlin/noise/).

You can also try refraction - in which you bend the ray using Snell's Law, and keep tracing into the surface. Combining this with a flying saucer shape (intersection of two spheres) makes a really nice optical lens. If you're really ambitious - you can make a telescope! Snell's law states that if a ray traveling from a medium with index of refraction of n1 enters a surface at an angle θ1 from the perpendicular to the surface, and enters into a medium that has an index of refraction of n2, then it will end up having an angle θ1 from the perpendicular to the surface, where n1 sin (θ1) = n2 sin (θ2). Typically, air has an index of refraction of about 1.0, and glass has an index of refraction of about 1.3 to 1.5.