CSC418/2504F: Fall 2001 Assignment 2

Oct. 10, 2001. Due: Oct. 24, 2001 in class.

Solutions:

look here.

New Due Date:

Oct. 26, 2001.

How to hand in your work:

Answers to frequently-asked questions.

Questions about marking?

  1. Transformations [6 marks] Consider the following 2-dimensional coordinate frames O, A and B.
    1. [1 mark] What are the coordinates of point P in frames A and B?
    2. [3 marks] What is the 3x3 homogeneous matrix MAB that, when multiplied by a point in frame A, yields that point's coefficients in frame B?
    3. [2 marks] What is the 3x3 matrix MBA that does the opposite conversion?

  2. Viewing and Projection [6 marks] Given a camera with the following parameters:
    Peye=(3,2,4) Pref=(0.5,0.5,0.5) Vup=(0,1,0),
    and with an image plane at z=-1 (in Viewing coordinates),
    1. [2 marks] What is the view matrix MWCS-VCS?
    2. [3 marks] On the image plane, what are the coordinates of vertices A,B,C,D and E of the following pyramid?
    3. [1 mark] There will be two vanishing points. What are their coordinates on the image plane?

  3. Modeling [4 marks] Consider the following skew cube, which is built as follows: The base abcd is a square on the xy plane with corners a(0,0,0) and c(1,1,0). The top efgh is the same square, rotated 45o around the point (0.5,0.5,0) and translated up the z-axis by (0,0,1).
    1. [1 mark] What are the coordinates of the eight vertices a,b,c,d,e,f,g and h?
    2. [3 marks] What are the outward-facing unit normal vectors for each of the ten faces of the object?

  4. Colour [6 marks] Write a program that displays the CIE chromaticity diagram, as an image made up of pixels. The diagram should show the following:
    1. [3 marks] The triangular gamut of colours that can be displayed by a monitor whose RGB phosphors have the following chromaticities:
      Phosphor x y
      R 0.628 0.330
      G 0.258 0.590
      B 0.1507 0.060
      Colours outside this gamut should appear black.
    2. [3 marks] The curve of pure spectral colours, with a white pixel at each 5-nm wavelength increment.
    3. [Bonus 1 mark] The blackbody curve for (T=1000K to 10000K, in 500K increments):
      • P(λ) = (2πc2h/λ5)/(ehc/kT-1)

      You will find skeleton code and data files on the following page:

      That page also describes the program's inputs. Submit your code electronically, using one of the following commands:
      • submit -N a2q4 csc418h cie.c
      • submit -N a2q4 csc2504h cie.c
      Submit a printed copy as well.

  5. Ray Tracing (6 marks)
    In ray tracing, primary rays are shot from the eye, through pixels, and tested for intersection with objects. Write a program to intersect a primary ray with a cylinder whose axis is parallel to the y-axis. The parametric form of a ray starting at P, in direction V is Assume all objects are in VCS. You program must use the I/O provided in the skeleton code: That page also describes the program's inputs. Submit your code electronically, using one of the following commands: Submit a printed copy as well.

  6. Hierarchies [4 marks] Write a program to draw and control this robot:
    Skeleton code is provided at Submit your code electronically, using one of the following commands: Submit a printed copy as well.