CSC418/2504F, Fall 2000: Assignment 2

Due: Oct 25th, 2000 in class. Late penalty: 20% per day.

Who marked what

Questions? Look for answers here and here.

EXTENSION: The deadline for the assignment has been extended until Friday, October 27th!

Please hand in your assignment to the teaching assistant during your tutorial hour, at 1pm. Note that assignments handed in on Monday, October 30th, will receive ZERO marks, because the solutions will be posted then.

Solutions.

  1. Change of Coordinates (6 marks).
    Consider the three coordinate systems O, A and B:
      Notation:
        MRS is a 3x3 homogeneous matrix, which transforms
        a point PR=(xR,yR,1) in coordinate frame R
        to a point PS=(xS,yS,1) in coordinate frame S.
    1. (1 mark) Write the coordinates of P in the three frames.
    2. (1 mark) Succinctly express MAB in terms of MOA and MOB.
    3. (1 mark) Succinctly express MAB in terms of MBA.
    4. (3 marks) Find MOA, MOB, and MBA. Show your work.

  2. Hardware (3 marks).
    A hypothetical graphics system can perform 106 additions/second, 5x105 multiplications/second, and 105 divisions/second. Assuming that each vertex must be transformed to CCS, projected to NDCS, and transformed to DCS, and that scan conversion, illumination and clipping costs are ignored,
    1. (2 marks) How many triangles per second can be transformed?
    2. (1 mark) Approximately how complex a mesh can be rendered in real time
      (60 frames/second), if it is made up of long triangle strips?

  3. Projection (8 marks).
    Given a camera with Peye=(3,2,2), Pref=(0.5,0.5,0), Vup=(0,0,1), and eye-image distance 1, and a scene consisting of a wedge:
    • A=(0,0,0)
    • B=(0,1,0)
    • C=(1,0,0)
    • D=(1,1,0)
    • E=(0,0,1)
    • F=(0,1,1)
    1. (4 marks) What are the coordinates of the projected points, in VCS?
    2. (4 marks) The wedge's four sets of parallel edges define four vanishing points.
      Compute them.

  4. Colour (8 marks).
    Consider a light source with the following spectrum
    I(λ) = (λ-300)/500, if 300≤λ≤800,
    I(λ) = 0, otherwise.
    1. (4 marks) Compute the chromaticity coordinates of the source.
    2. (2 marks) Plot the colour on the CIE diagram. Assuming the white point
      has (x,y)=(0.33,0.33), what is the source's dominant wavelength?
    3. (2 marks) Compute the RGB components of a colour with the same chromaticity,
      such that max(R,G,B)=1.
    4. (Bonus 1 mark) Plot the complete chromaticity diagram. The tongue-shaped outline should be enough. If you want to fill in the colours, explain the limitations of your colour choices.
    The CIE x,y,z functions, the chromaticity diagram, and a matrix for converting XYZ to RGB are online at:
    www.dgp.utoronto.ca/~ah/csc418/fall_2000/coursework/a2q4

  5. Ray Tracing (10 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 polygon. 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: The program is given the following data:
    1. W,H : dimensions of the image, in pixels.
    2. Left,Right,Top,Bottom,Near,Far : camera's viewing volume.
    3. x,y : pixel coordinates.
    4. v0,v1,...,vm : vertices of a polygon.
    Suggested procedure:
    1. Compute P and V for a ray through (x,y).
    2. Compute the equation Ax+By+Cz+D=0 of the plane containing the given polygon.
    3. Compute the intersection T of the ray and the plane.
    4. Project T and the polygon onto one of the coordinate planes (xy, yz, or xz).
    5. Perform a point-in-polygon test (code is provided for you).
    Submit your code electronically, using one of the following commands: Submit a printed copy as well.

  6. Hierarchies (10 marks).
    Write a program to draw the following robot with four degrees of freedom θ1, θ2, L, D:
    Your program must NOT use the openGL functions glRotate, glTranslate, or glScale. Use only the glMultMatrix and glLoadMatrix functions. You must use the skeleton code provided, which reads in the four degrees of freedom: Submit your code electronically, using one of the following commands: Submit a printed copy as well.