CS461 - Assignment Four

Due: 2016-10-12, 1:45p

Objectives

For all problems, please show all of your work for full credit.

For some problems you may need the trig identities. Here is a reasonable list: (http://www.mathwords.com/t/trig_identities.htm)

Problems

  1. [5 points] Derive a transformation matrix that provides a reflection across the line y = x.

  2. [8 points] In order to display our OpenGL world, the graphics pipeline needs to figure out what point in our world each pixel in the canvas corresponds to. You have already had to figure this out to implement clicking. I would like you to formalize this. We have the view (canvas), which has an origin in the upper left, y increasing down, a width of VW, and a height of VH. Our world (OpenGL-land) has its origin in the center, a width of WW and a height of WH.

    a. Write a pair of formulas to convert a point in view space (xv, yv) to the appropriate point in world space (xw, yw).

    b. Construct a transformation matrix to perform this calculation (in 2D)

    Hw04 Window

  3. [5 points] I mentioned in class that we can invert a rotation by taking the transpose of the rotation matrix. Use matrix multiplication and a little trigonometry to demonstrate that this is true. (This can be done with a simple trig identity, but I would like you to do the multiplication).

  4. [6 points] Prove that the following matrix operations are commutative a. two translations b. two scalings

  5. [8 points] Find the view matrix for when we want to look at the point (1,2,1) from (3,3,3,). Assume that the camera is approximately upright.


Turning in your work

You may hand in paper copies in class. If you prefer to submit electronically, submit as a pdf on Canvas as usual.