CS 5600 - Spring 2009

Homework Assignment 4

Hierarchical Transformations (100 points)

Handed out: Feb 18, 2009
Due: midnight, Tuesday, Feb 24, 2009

You will write a program that makes a multi-pinwheel that spins.  You should have one gigantic pinwheel that turns around the center.  The pinwheel is composed of three other pinwheels which each are turning about their center.

For example:

 

 

 

 

 

 

 

 

 

 

You should color your polygons as you wish but don't make it boring. You should use OpenGL triangles for drawing (set the color before the vertex call).  2D polygons are fine.  The example program you have been using provides the basis for this assignment.  Your multi-pinwheel should be about 120 pixels high and wide.  It should move along a square in your 512x512 window (127,127) to (383,127) to (383,383) to (127,383) to (127,127).  It should translate while spinning.

1. You program should compile and run on the CADE

2. You should control the rotation speed with keystrokes: 'f' for faster, 's' for slower (look at the example code for 'q' and 'Q'.)  The translation speed should be fixed.

3. You must use hierarchical transformations for the translation and rotation, you may wish to experiment with scaling over time as well.  Make it look nice!

4. Draw into a 512x512 window.  You do not need to handle resize events.

5. You must document the hierarchy you used (draw the tree) in your writeup.

Extra Credit: you may get a few extra credit points by making an additional animation with at least 3 levels of hierarchy including multiple branches at each level.

Output

The program should draw its output to an OpenGL window of size 512x512 as in the example program.

Submission

use the handin routine in the CADE Lab. You can with zip or tar your solution. You should comment your code appropriately and hand in a web-page that will serve as complete documentation. Please include a paragraph of difficulties and a paragraph of what you learned in this assignment.

The handin name for this lab is "lab4".

Windows users should use the Zip utility and handin a single zipped file. Unix users should use the tar program to do the same. We will recompile the programs to grade them. Make sure your workspace/program will compile for us. That is, be careful about your user-specific pathname variables! If you do this on a home machine, please allow sufficient time for porting to the CADE machines. We will grade based on compiling and running on the CADE machines.

Due to a bug in the handin program, do not include spaces in the names of the files that you submit, otherwise we will not receive them. For instance, "no spaces.txt" is not a valid filename and would not be received, while "no_spaces.txt" is valid. Please keep this in mind while handing in your assignment.