Sections:
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. |
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:
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!