program4.zip (Visual Studio 2008 project)
This creative image demonstrates that my ray tracer is able to do motion blur. This scene consists of two phong shaded moving spheres, a diffuse ground and a dielectric sphere directly between the orange moving sphere and the camera. There is also an area light source and a thin lens camera that is focused on the orange moving sphere.
I also decided to see what the first image we did in this class would look like with these new materials and methods. Below is scene one with an area light source, soft shadows, glossy metal and a thin lens camera.
This assignment I found to be pretty fun. I implemented an area light source, thin lens camera, and a glossy metal material. I also did some simple anti-aliasing, taking random samples from the pixel as the origin of rays. For this assignment I created an Area Light class, Thin Lens Camera class and Glossy Metal Material class. I also decided to implement a moving sphere class to demonstrate the ability of my ray tracer to do motion blur (more on this later).
I added motion blur to my ray tracer for Extra credit. I decided the easiest way to accomplish this would be to make Moving Object classes. I added an attribute to my Scene class called MaxDuration. Max duration specifies how long the scene is. Then for each sample I generate a random "time slice" between zero and the scene's MaxDuration. I pass along this time slice with the rendercontext so any object that requires it can use it. I implemented a Moving Sphere class which is essentially just like a Sphere but with slightly different normal and intersect methods. Moving spheres have a velicity attribute which is just a vector specifying the x, y, z velocity. I then take the speed passed in by the Render Context, multiply it by the velocity, and add it to the spheres original center. This implementation works pretty well and Im rather pleased with the results.
Time Required: This assignment took me about 5 hours to complete.
Difficulty: I would rate this assignment as a 4 in terms of difficulty. I only had to add about 20-50 lines of code total.
Copyright Ben Hillis - University of Utah 2009 all rights reserved.