# Homework 4, due Wed Sept 25, 2013

Hand in your solution on RPILMS. Each team should submit their solution under only 1 student's name. The other student's submission should just name the lead student. (This makes it easier for us to avoid grading it twice.) For programming exercises, hand in code and screen dumps. We won't run your code, but will use the screendumps to judge how it worked.

Corrections are in bold.

1. (10 pts) (This is a test of complex a scene your machine can handle.)
1. Write a simple OpenGL program to read an integer N, and then draw N random triangles, each of width 1/10 of the width of the window.
2. Run the program repeatedly with N=10, 30, 100, 300, ..... until something crashes, or it gets so slow that your patience runs out.
3. Report your machine HW and SW, what happened, and when it happened.
2. (2 pts) Write the 4x4 matrix for a 3D translation by (2,3,4).
3. (2) Apply it to the 3D point (1,0,1).
4. (2) Write the 4x4 matrix for a multiplication about the Y axis by 90 degrees.
5. (2) Apply it to the answer from question 3.
6. (2) Multiply the matrices that are the answers to questions 2 and 4, with 2 being on the right.
7. (2) Apply that matrix to the point (1,0,1). The answer should be the same as question 5.
8. (2) Why is it useful that translation be a matrix multiplication?
9. (2) Suppose that you specify two colors before drawing a point thus:
glColor3f(1.,0.,1.);
glColor3f(0.,1.,0.);
glVertex3f(10.,20.,30.);
What color is the point? E.g, do the magenta and green mix to make the point white?
10. (2) Suppose the you draw a second point w/o specifying the color again. What color is this point? E.g., does it revert to black?
11. (2) (Reverse engineering rotations) In 2D, if the point (1,2) rotates about the origin to (2,-1), what's the angle?

(Total: 30 points.)