Project One
Submit Assignment
Due Nov 14 by 11:59pm Points 100 Submitting a file upload Available Oct 7 at 12am Nov 14 at 11:59pm about 1 month
Description: Your ray tracing work will conclude with this project. The project will require you to implement shadow feelers to create shadows, trace reflection vectors to create mirror-like inter-object reflections, and add additional types of shapes to a scene. Your starting point for this lab is your completed lab four.
Your grade on this project will depend not only on successful implementation of additional aspects of ray tracing, but also on quality of the scene that is rendered by your project.
Reflections: Implement reflections and include reflective objects in a scene. Shadows: Implement shadows and include shadows in your scene.
Refraction / Transperencey: In addition to sending a reflected ray through a surface, include one glass object that sends refracted rays.
For this, you will have to add an additional parameter to the rayTrace function; the current index of refraction (IOR). The IOR of glass is 1.66, and the IOR of air is 1.0003.
Bounding Box: Implement a bounding box object that can be used to quickly check if a ray intersects an axis-aligned box. An axis aligned bounding box is described by size parameters: xmin, xmax, ymin, ymax, zmin, and zmax. This is an important function when you have complex scenes which you want to divide in a hierarchical ray, so you can skip checking for ray intersections of objects if the ray does not even hit their bounding box.
You can try to solve for BoundingBox::hit formula yourself or use google; for example an algorithm is described in this JGT paper http://www.cs.utah.edu/~awilliam/box/box.pdf (http://www.cs.utah.edu/~awilliam/box/box.pdf) .
Meshes: A mesh is a collection of triangles. Write a Mesh class with the folowing methods:
1. getBoundingBox(). You should always check if a ray hits the bonding box of the mesh before echsking
each triangle it contains.
2. load(path). Read a mesh frm an OBJ file. An example OBJ file is here:
https://people.sc.fsu.edu/~jburkardt/data/obj/teapot.obj (https://people.sc.fsu.edu/~jburkardt/data/obj/teapot.obj) . I want you to write the function to load an OBJ file into a vector of vertices and a vector of traingles. You parse an OBJ file be reading it one line at a time. If
the line starts with a v then the rest of the line has the x, y, z coordinates of a point that should be stored in a vector. If a line starts with f then it is a bit more complicated, but you can limit yourself to the teapot example in which it is followed bu the indexes of the 3 vertices of a triangle.
3. gatMaterial/setMaterial, which I beleive will be inherited from a Surface class. You should be able to render a Teapot with a material of your choice.
Video: I want you to generate a sequence of frames in which, at least, the camera is moving. Save each frame to a numbered file frame-%06d.ppm. Then use ffmpeg to generate a video.
Reviews
There are no reviews yet.