Brandon McPhail
Last Modified: 15. May 2003
linux i386 binary
(Released under GPL)

Final Project README

loop.c, loop.h, object.c, print.c

This is an extension of project 2: Loop's subdivision. I've added color-cycling and animation. I also patched a couple of bugs along the way.

Using the modified object viewer

Most of this program is described in the Project 2 README; however, some of the interface is different. I've added 3 commands:

[M] toggle
Turn the animation on or off.

In each pass through the animation loop:
  1. The diffuse color value for the light is shifted slightly for a rainbow effect.
  2. The model is spun slightly for a rotating effect.
  3. Each vertex is mapped to a new position as follows: Before the animation begins (ie. when you turn it on), the average distance from the origin is computed from all the points in the model. For each pass through the animation loop, the position of each vertex is scaled:
    v' = v0 + (|v0| - r) * cos(theta)
    where v0 is the position of the vertex before the animation began, r is the average distance from the origin of all v0's, and theta is a value that is incremented by pi / 16 for each pass through the loop. The result is a wobbly shape that oscillates across an invisible sphere of radius r.
[+] faster
Speed up the animation.
[+] slower
Slow down the animation.

One interesting thing about the animation is that is functions as a measure of how badly Loop's subdivision of ball.obj fails to approximate a sphere. After each subdivision, the shape just gets wobblier.
Want to drop me a note? Do so: Send me an email!
<-- Back