CS 6620
Project 3
Chelsea Robertson
Required Images
Code Listing
My source code for project 3 can be found
here.
Creative Images
My creative images are a day and night scene of the coast
of Honolulu, Hawaii. The new objects I use are the box, triangle, disk and
heightfield. I used terrain data found on the web for the heightfield, a plane
for the ocean, boxes and triangles for the boats, and disks for the sun/moon
and clouds.
Design Choices
There weren't many new decisions to be made for
this project because we were mainly implementing new objects. Below are some of the design decisions I made:
- The disk, ring, and triangle classes are all derived from my primitive
class, like the previously defined objects. I followed the notes to implement
all of the intersect functions for these objects.
- I decided to implement a scratchpad. I use this to compute the normals for
the triangles and heightfields. For triangles, I used normals specified at each
vertex. For heightfields, I follow the patch normals algorithm outlined in
the notes.
- For the box intersection, I decided to implement the ray-box intersection
algorithm in the notes. I decided to use this rather than the one in the
paper, because I used the primitive class for all of my objects. In order to
implement the more efficient intersection algorithm I would have had to modify
the function to take in additional parameters. I thought this would be more
trouble than it was worth.
- For the heightfield, I followed the implementation in the notes. I used
the bilinear patch intersection, implementing version 3 of the ray-patch
intersection algorithm, as recommended in class.
- Scene description:
- A scene consists of a background, camera, lights, ambient light, objects
and an image.
- The background, camera, lights, ambient light and image are all directly
added to the scene.
- A group is created and the objects are added to this group, which is then
added to the scene.
- I also finally included Time.h to keep track of the rendering time.
Extra Credit
For the extra credit, I first downloaded and converted the
terrain data for my hometown, Buffalo, NY, but it wasn't very exciting. So
instead, I decided to call Honolulu, Hawaii my home for this assignment. It
was 1371x1284, with a minimum z value of 0 and a maximum z value of 959. I had
to modify the mds file so that the first two numbers correspond to the number
of cells not points. I also had to switch the order so it the number of cells
in x and y instead of vice versa. In addition, I needed to scale the data.
The heightfield can be seen in my creative image above, or alone in the images
below.