CSCI 480 / 580 - Written Homework 2

Complete the following problems and submit your solutions to the HW2 assignment on Canvas. For all questions, justify your answers either or showing your work or giving a brief explanation. Please typeset your solutions using latex or similar (you can find the Markdown-plus-latex source for this document here). You may work with your classmates on these problems, but you must write up your own solutions individually without using notes or photos made during your collaborative discussions. As usual, this is new material, so please let me know if you think anything is unclear or ambiguous and I’ll make corrections or clarifications as needed.

  1. We’ve seen that applying a 2x2 linear transformation \(A\) followed by a translation \(\vec{t}\) can be accomplished either by computing \(A\vec{p} + \vec{t}\) or by using homogeneous coordinates, by adding a \(w\) coordinate to \(\vec{p}\) and putting the \(\vec{t}\) in the third column of the transformation matrix. This can be written in block matrix notation as follows - I’ve included subscripts showing the dimensions of each block to be clear about what’s happening:

\[ \begin{bmatrix} A_{2x2} & \vec{t}_{2x1} \\ 0_{1x2} & 1_{1x1} \end{bmatrix} \begin{bmatrix} \vec{p}_{2x1}\\ 1 \end{bmatrix} \] Show that composing these 3x3 transformations still works via matrix multiplication. In other words, show that the following operation (I’ve dropped the subscripts, but the block structure is the same as above): \[ \left( \begin{bmatrix} A & \vec{t} \\ 0 & 1 \end{bmatrix} \begin{bmatrix} B & \vec{s} \\ 0 & 1 \end{bmatrix} \right) \begin{bmatrix} \vec{p}\\ 1 \end{bmatrix} \]

gives the same result as

\[ A\left(B\vec{p} + \vec{s}\right) + \vec{t} \]

  1. Give a 2D affine transformation matrix that stretches an object by a factor of two along the direction \(30^\circ\) counter-clockwise from the \(x\) axis. Feel free to use software to form and multiply your matrices, but if you’re composing multiple transformations, please write out each component as well as the final combined matrix.
  2. Give a matrix that transforms the normals of a shape that is sheared in the \(y\) dimension only, such that \(y' = y + 2x\). Again, give you answer as a matrix of numbers, but feel free to use software to compute it.
  3. In this problem, we’ll build the Model and Camera matrices necessary to make a wireframe rendering of a skyscraper. Feel free to use software to compute and/or check your matrix math. Be sure to clearly denote each component matrix.

    1. Model Matrix We’ll start with the cube triangle mesh we used in A1 and A2. Recall that this cube is centered at the origin and has side length 2. Write the model matrix (i.e., the transformation that maps the cube from its home coordinate system into world coordinates) to create a skyscraper given the following information:
      • World coordinates have units of kilometers.
      • The corner of the skyscraper corresponding to the model cube’s (-1, -1, -1) corner is at 4km in the x direction from the origin, 3 km in the z direction from the origin, and at ground level (y = 0).
      • The skyscraper is 0.5km high and has a 0.06 km square footprint (the approximate dimensions of One World Trade Center)
    2. Camera (View) Matrix A camera is mounted to a helicopter hovering over the origin at (0, 1, 0). and is looking towards the point (3.0, 0.2, 4.0). The camera is level, or in other words, each row of pixels in the image is orthogonal to the direction y = 1.
  4. You may recall from linear algebra that the identity matrix maps points to themselves. For points in \(\mathbb{R}^4\), the identity matrix is a 4x4 matrix with ones on the diagonal and zeros everywhere else. Although our 3D projective transformations are also represented by 4x4 matrices, they actually represent functions on a different mathematical space (appropriately, it’s called projective space). For points in 3D projective space (i.e., 3D homogeneous coordinates - \([x,y,z,w]^T\)), there are actually many matrices that map points to themselves. Describe the form of all possible identity matrices on 3D homogeneous coordinates.