CS 6620
Project 2
Chelsea Robertson
Required Images
This is the final image with the eye point above the
plane.
This is the final image with the eye point below the
plane.
Code Listing
My source code for project 2 can be found
here.
Creative Images
My first creative image contains 3 point light sources,
a ground plane, and many spheres. I thought it was cool because the lights are
red, green, and blue, and this is apparent in the shadows cast on the plane by
the spheres.
My second creative image is just 200 spheres. The
location, radius, and color of each of the spheres is randomly generated.
Design Choices
Below are some of the design decisions I made for this
project:
- I decided to implement all of the base classes specified in the notes,
including the primitive intermediate class. I thought it would be useful to
have the simple abstract base classes to use. I also chose to leave all of the
data as public, so that I could directly access it. I thought it would be easier
than writing class methods to do this.
- I also chose to use floats and offset the intersection points by .001,
instead of using doubles and .000001.
- As seen in the second image above, I chose to implement the Lambertian
shading using the two-sided lighting. I took the dot product of the normal
with the light direction, so the shadows are visible from the other side.
- I also chose to use the unit vector method for the ray-sphere
intersection. It seemed to be the easiest to implement and not much more
costly than the most optimized method.
Extra Credit
I didn't get a chance to implement any of the extra
credit.