Lab 9: Integration
Will Moss & Andrew Cantino

This is lab 9 of Computer Graphics. In this lab we fully integrate our lighting model into our hierarchical modeling system, then we make some pretty pictures.

Sections:

API

We have created an updated API for our graphics environment. It can be found here.

Images

Interpolating CVV coordinates across our polygons in our z-buffer algorithm turned out to be tricky and we ran into a number of small bugs. The main bug was that we were not dividing by the correct Z values when we found delta CVV X and Y per scan-line, which generated the following glitching in our images (notice the horizontal lines):

Once we had all of the bugs worked out, we made the following images:


Space Tron! (a.k.a I think the bee will win) by Will
Click for larger version.

All models from 3DCafe.com
View source code.

Enterprise orbiting a parameterized tomato! by Andrew
Click for larger version.
View source code.

Extensions

Shadow Rays
As an extension, we have completed our implementation of shadow rays, started in the previous lab. We ironed out a few bugs and made the following pretty example images:


Blue light over the bottom right corner of the pyramid,
white light above the pyramid.
Click for larger version.

Blue light orbiting close to the pyramid,
white light above the pyramid.
Click for larger version.

Rendering Parameterized Surfaces
We implemented rendering of parameterized surfaces. There is a new modelPrimative called paramObject3D that takes a pointer to a function that takes a u and v value and returns a point3D. Additionally, paramObject3D takes step sizes dU and dV to define the resolution of the parameterized surface to generate. Here are some example images:


A torus!

A superellipsoid!
Click for larger version.

A rotating superellipsoid!
Click for larger version.

Polygonal Meshes & Model Loading
We wanted to be able to load ASE models into our modeling system, so we created a polygonal mesh class that can be used for adding arbitrary lists of points and polygonRefs to our model hierarchies. This makes it easier to create complex models, and gives us a structure to import ASE point and polygon lists into. We created a library called modelio and added ASE import code. Here are some fun examples!


Mmm, Fish!
Model from this site.
Click for larger version.

Eagle -- 33,000 triangles.
(Source: 3dcafe.com)
Click for larger version.

Sphere with shadow.
Model from this site.
Click for larger version.

Other Small Additions
We made a number of other small additions, such as the ability to add sunlight and spot lights. We also finally added backface culling and found that it fixed all sorts of problems -- doh!

[Back to Lab Index]