CG Homework 3, due Thu 2016-09-22 9am

1. (10 pts) Part of changing from one coordinate system to another is scaling and making things fit. E.g., suppose that you had a square with lower left corner (llc) (0,0) and upper right corner (urc) (1,1). You want to scale and center it to just fit into a rectangle with llc (0,0) and urc (2,3). The square stays a square but is probably larger or smaller. Then, these equations would do it:

x' = 2x
y' = 2y + 1/2

This question is to figure out how to make a rectangle from (0,0) to (2,3) fit into a square that is from (0,0) to (10,10).

2. (10 pts) Consider a pinhole camera as discussed in slide 12 of ppt presentation 1_5. Let d=2. To where does the point (1,3,-2) project? Use the equation on that slide. x/z/d should be parenthesized as x/(z/d).

3. (5) If your image has only 64 different colors across the whole image, how many bits per pixel do you need for the color buffer?

4. (25) Extend your program from last week that displays the Starship Enterprise as follows:

1. Add 3 sliders that will rotate it around the X-axis, Y-axis, and Z-axis respectively.
2. Do the rotations the simplest (and least efficient) way. I.e., in your javascript program, have render rotate the matrix and resend it to the GPU.

(Total: 50 points.)