Problem Set #1 due Thursday, April 15th

 
Problems 1 and 2 can be done collaboratively. Problem 3 must be done individually.

1. Vertex transformation problem

The Modelview matrix has been moved 10 units forward along the negative z-axis and then rotated 45 degrees counterclockwise around the y-axis. The width and height of the screen is 400x300 and the Projection matrix encodes a normal perspective transformation defined by a fovy of 60 degrees, a near plane of 1 unit and a far plane of 100 units.

A point in object coordinates is (.5, 1.0, -2). Describe the point at each stage as it gets turned into a pixel. What is the point in eye coordinates? in clip coordinates? in normalized device coordinates? And finally, what pixel does it end up as? Use the information from last week's slides or from the OpenGL Red Book. Show work. Double check with code.

Grading: 10pts.
Extra Credit: How would you take a point in pixels with a given depth, say (100, 100, .5) and determine it what it is in 3D object coordinates?

 
2. Camera problem

You are making a 3D version of Asteroids. Your ship/camera needs to be able to rotate in all directions and to be able to move forward in the direction it is facing. Define a camera class which controls both the relevant information for defining the Projection matrix and also the relevant information for defining the View portion of the Modelview matrix. Your camera should have the following functionality, which can be called by keyboard commands:

rotateAroundX(float angle); //UP, DOWN arrow keys
rotateAroundY(float angle); //LEFT, RIGHT arrow keys
rotateAroundZ(float angle); //SHIFT-LEFT, SHIFT-RIGHT arrow keys
thrust(float distance); //SPACE bar
changeFOVY(float angle); //A, Z letter keys

Draw a series of six "asteroids" at the following positions (in absolute coordinates): (0f, 0f, -10f), (0f, 0f, 10f), (0f, 10f, 0f), (0f, -10f, 0f), (10f, 0f, 0f), and (-10, 0f, 0f). Each asteroid should be drawn using a different shape (you can use the glu or glut shapes or make your own) and using a different color. That is, they need to be visually distinct. Each asteroid should rotate around its center at a different rate in a different direction. Initially position your ship/camera at (0f, 0f, 0f) facing the first asteroid.

Grading: 30pts, based on accuracy of solution and robustness, readability of code.

 
3. Aesthetically-constrained animated art problem

Choose an abstract 2D painting or illustration from the 20th century, or choose a more contemporary abstract piece (maybe from the dataisnature.com site?). Please check with me to make sure it is a feasible piece. Make a 3D version of the piece using only basic OpenGL drawing commands, texturing, and lighting. Animate your camera class to automatically move through the piece in an aesthetically pleasing way. Each piece should last for exactly 120 seconds. Objects in the scene can themselves be animated, but this is not required.

Grading: 60pts, based on successful emulation of original piece, elegance of camera animation, and general creativity.