CS 381, Fall 2007
HW #4

General Information

Homework Policies

See the Homework Policies handout.

Questions (5 pts)

  1. Exercise 4.22
  2. Exercise 4.16.
  3. Derive the 2D transformation matrix, R(theta,P), for a counterclockwise rotation by angle theta around the point P=(px,py). Demonstrate the tranformation by multiplying R(45,P) by the point (2,1), where P=(1,1).

Program #1 (5 pts)

Exercise 4.15. Start with the 2D recursive sierpinski gasket program (gasket2d.c) from Chapter 2 of the text and replace the vertex calculation code with instance (model) tranformations to original triangle.

Program #2 (10 pts)

Compile and run the OpenGL program cube.c from Chapter 4 of the text.
  1. Modify the program by moving the update code to a timer callback function which updates the display at a rate of 10 frames per second.
  2. Using (a) as the starting point, complete Exercise 4.20.

Note

Particularly well-done programs may be demonstrated in class.


CS 381, Fall 2007: Assignment 4 / Last update: 11 Oct 2007