Exercise Solution

Part 1

Draw a wireframe unit cube in isometric view.
  • The default viewing volume uses orthographic projection. Draw a cube using orthographic projection. [Angel 2.6.1, 4.6]
  • Position the cube in the world coordinate system with its diagonal going from (0, 0, 0) to (1, 1, 1).
  • Draw lines instead of triangles to draw in wireframe. [Angel 2.4]
  • Build a model-view matrix that transforms the cube vertices so that the cube is in isometric view. [Angel 4.12, 5.1.3, 5.3]
Please use a browser supporting HTML5

Part 2

Draw the unit cube in different classical perspective views.
  • Introduce a projection matrix that sets the camera to be a pinhole camera with a 45 degrees vertical field of view. [Angel 1.4.1, 5.5-5.7]
  • Draw the cube three times in the same rendering. Transform the cubes so that one is in one-point (front) perspective, one is in two-point (X) perspective, and one is in three-point perspective. [Angel 4.9-4.11, 5.1.5]
Please use a browser supporting HTML5

Part 3

Reflect on the theory of affine transformations and viewing transformations by doing the following:
  • List the transformation matrices that you used in Parts 1 and 2 (use general expressions rather than concrete numbers). [Angel 4.9, 5.3-5.5]
  • For each cube, write down a formula showing how the matrices were concatenated to become the current transformation matrix (CTM) that was used to transform the vertices in the vertex shader. [Angel 4.10-4.11]
  • Matrices used:
    • Part 1 - Translation matrix, rotation around Y axis, rotation around X axis
    • Part 2 - Translation matrix, scaling matrix, perspective matrix, look-at matrix
  • CTM formulas:
    • Part 1: CTM = rotateX * rotateY * translate
    • Part 2, 1-point: CTM = translate * scalem * perspective * lookAt
    • Part 2, 2 and 3-point: CTM = translate * scalem * perspective * translate * lookAt