First Name: _____________________________
Student ID: _____________________________
Attempt all questions.
There are four questions.
The total mark is 24.
You have 50 minutes to complete the test.
Aids allowed: Brains, writing implements, calculators and prayers.
Textbooks and notes are NOT allowed.
1. Illumination: [8 marks] Laser scanners are now a common way to capture the shape of a real object. The figure below shows how they work: A focused point laser (like a single ray) is fired at the object in direction R. At the same time a camera focused on the object picks up the laser reflecting off the object. Given the position of the camera and reflected spot in the camera image, the viewing ray for the camera V, is determined. Now the 3D point on the object hit by the laser is the intersection point of the rays R and V. Sweeping the laser over the object gives a number of 3D points on the object, capturing its shape.
a. [4 marks] Will such a scanner for work for objects with a high ambient, diffuse or specular component? Explain.
b. [4 marks] The laser is positioned at <0,0,0> with its ray directed along <2,1,1>. The camera is positioned at <7,0,1> and ray for the reflected image <-1,3,2>. What is the position of the 3D surface point captured by this setup.
2. Projection: [6 marks] A unit cube lit by a point light at L(1.5,2,0) casts a shadow on the walls (xy, yz planes) and floor (xz plane) as shown:
a. [2 marks] What are the coordinates of A', B' and C', the three corners of the shadow? (C’ is not shown to avoid clutter in the figure)
b. [4 marks] For an arbitrary point P(x,y,z), how would you determine which wall or floor it would cast a shadow on, and what are the coordinates of this shadow point P'(x,y,z)?
3. Visibility: [6 marks] We wish to write a shader that draws only the silhouettes of a polymesh objects. In other words we want to display the object by only drawing the edges that form the outline of the object. For an edge E, let V1,V2 represent its adjacent vertices, and F1, F2 its adjacent faces. The normalized normal vector for a face F is F’ and for a vertex V is V’.
a. [2 marks] For a convex polymesh object, write an algorithm that given an edge E, and viewpoint V, determines whether E is a silhouette edges.
b. [2 marks] Will your test work for concave objects as well? If not draw an example of a concave object and viewpoint and mark out an edge for which this test would fail.
c. [2 marks] We will scan convert the edge by interpolating the color of a point P on the edge from the color C1,C2 at V1, V2 respectively. What is the color at P as a function of C1,C2,V1,V2 and P?
4. Clipping and modeling: [4 marks] Describe a clipping algorithm (pseudo-code) that would return the fragment of a polygon inside a viewport as shown in the figure below. You may use as function calls: