CS 5620/6620 - Fall 2025 - Rendering with Ray Tracing
Project 5 - Triangle Meshes
In this project we add plane and triangle mesh object types to our ray tracer.
Requirements
Implement plane, triangle, and bounding box intersections. Render a scene that includes a triangle mesh with lighting and shading.
XML Scene Format
We have a minor addition to the XML scene format to support new object types: plane and triangle meshes. The plane object is a square with 2 unit lengh edges. It is placed at the origin and the plane normal is aligned with the positive z-axis in object coordinates.
Triangle mesh is specified in an external OBJ file. The name of the object is the filename of the OBJ file, which should be placed in the same folder as the scene XML file.
The following source code files are provided to help you with this and upcoming projects. You are not required to use them, but it is highly recommened that you use some of them. Some of these files include additional code as compared to the same files in the previous project, so make sure to download them all again.
renderer.h: Includes minor additions to the shade information class.
scene.h: Includes updates to the hit information class and a new Box class for handling bounding boxes and additional classes for storing loaded object files.
objects.h: Includes the description of the Plane and Triangle Mesh Object classes.
xmlload.cpp: Includes new code for reading the data for the new Object classes.
viewport.cpp: Includes implementations for displaying the new Object classes in the OpenGL viewport.
The following scene files are provided to help you test your implementation. You can also prepare other scenes to show your work.
Cornell Box Scene: A Cornell Box scene with two Utah Teapots and a ball. The ball has a refractive material and the teapots have a reflective material.
Teapot OBJ: A mesh version of Utah Teapot used by the Cornell Box scene.
Teapot OBJ (low-resolution): A low-resolution mesh version of Utah Teapot that is more suitable for debugging.
Plane OBJ: A plane object that can be used for testing and debugging triangle mesh intersections.
Optional Feature Suggestions
Report render times with and without bounding box tests.
References
[Möller-Trumbore 1997]
Tomas Möller and Ben Trumbore. 1997. Fast, minimum storage ray-triangle intersection. Journal of Graphics Tools 2(1):21—28.