CPSC 4050 / 6050
Spring 2014
Mighty Fine Tea
Homework
Assignment 6
Due: Tuesday, April
22, 2014
Problem
Description:
For this
assignment, you are encouraged to form teams of up to three
people. The project will be to build a program that allows you to
use OpenGL to interactively position a camera in a scene
containing a teapot, a groundplane, and a background plane, and
then to be able to render the scene using raytracing. In order to
make the scene interesting you should provide texture maps for the
ground plane, the background plane, and for the teapot. Here are
links to .obj files for the
teapot, and a light
version of the teapot with reduced polygons. The light
teapot will be useful for debugging as it contains only 112 quads
and 16 triangles. The full teapot contains 3120 quads and 80
triangles.
To get you started on this assignment, I provide an interactive program that
demonstrates the use of OpenGL to do interactive viewing, shading,
and texture mapping. You already have my obj reader code, which will
load an obj file, and associated mtl file, along with any texture
images. And, I here is my implementation of
the BIH Tree, along with associated objects. Note, in this
code I have slightly modified how I represent a Face in a
PolySurf.
Basic
Requirements:
The minimal
requirements for the assignement are to:
- Update the
.obj files for the teapot, to include the ground and background
planes, as well as materials and texture maps.
- Be able to
read the .obj and .mtl files, and build a complete data
structure representing the teapot and the planes.
- Display the
resulting polygonal model in wireframe, using either
orthographic or perspective viewing.
- Allow the
user to adjust the viewing window to set the image size and
proportions.
- Display the
model as a solid, properly lit and shaded and texture mapped,
using the material properties from the .mtl file.
- If surface
normals are provided for the vertices of a model, display the
model using smooth shading.
- After
adjusting the camera interactively, the user should be able to
press the 'r' key to cause a raytraced image to be produced and
displayed in a view window.
- After the
raytraced image is created, the user should be able to press the
'w' key to cause the raytraced image to be saved to an image
file.
Advanced
Extensions:
-
Compute the ambient occlusion for each ray, by shooting a set
of randomly directed rays from each surface hit-point and
counting how many rays reach a hemisphere placed over the
surface hit point.
Contest:
There will be
a contest for the team with the best image. In order to be
competitive, you should experiment with some of the lighting and
shading techniques discussed in class. You can use a number of
lights, including spotlights, to enhance the lighting effect. You
can use procedural shading to produce interesting surface
patterns, and surface normals. You can use normal maps, along with
texture maps to enhance the look of a surface. You can approximate
one of the effects of global illumination by shooting randomly
directed rays from each hit-point, giving you color bleeding from
other surfaces in the scene.
General:
Please write
the program in C++ , using OpenGL and GLUT graphics routines for
the display. Make sure to put a header in each file of your code
that gives a description of the program or object, your name, the
date, and instructions on how it is used. Please turn in at least
two different images you have made with your renderer.