Docsity

Final Exam for Computer Graphics I | CS 4620, Exams of Computer Graphics

Toggle sidebar
bg1
CS 465 Final Exam
Friday 10 December 2004
2.5 hours
Problem 1: Filtering & Resampling (20 pts)
1. Consider an image consisting of a square of four adjacent white (pixel value = 1)
pixels on a black (pixel value = 0) background:
.
.
.
· · ·
0 0 0 0
0 1 1 0
0 1 1 0
0 0 0 0
· · ·
.
.
.
What is the result of resampling this image to increase its resolution by a factor of
3
2using bilinear interpolation (that is, using a separable tent filter)? Assume that the
upper left white pixel aligns exactly with a pixel in the resampled image. Compute
your result by the separable filtering method, and give your answer as two arrays
of numbers like the one above: one for the intermediate result and one for the final
output.
2. Suppose we filter the same 2x2 square twice with the following discrete filter:
1
16
1 2 1
2 4 2
1 2 1
Show how to compute the result easily on paper using a small number of easy mul-
tiplication and addition operations (you can do it with less than a dozen individual
operations, not counting multiplication by 1 and 0 and addition to 0). Take advantage
of separability, associativity, commutativity, and symmetry. Give the final answer as
another array of numbers, but use symmetry to reduce writing if you like.
1
pf3
pf4

Partial preview of the text

Download Final Exam for Computer Graphics I | CS 4620 and more Exams Computer Graphics in PDF only on Docsity!

Friday 10 December 2004 2.5 hours

Problem 1: Filtering & Resampling (20 pts)

  1. Consider an image consisting of a square of four adjacent white (pixel value = 1) pixels on a black (pixel value = 0) background: .. .

What is the result of resampling this image to increase its resolution by a factor of 3 2 using bilinear interpolation (that is, using a separable tent filter)? Assume that the upper left white pixel aligns exactly with a pixel in the resampled image. Compute your result by the separable filtering method, and give your answer as two arrays of numbers like the one above: one for the intermediate result and one for the final output.

  1. Suppose we filter the same 2x2 square twice with the following discrete filter:

Show how to compute the result easily on paper using a small number of easy mul- tiplication and addition operations (you can do it with less than a dozen individual operations, not counting multiplication by 1 and 0 and addition to 0). Take advantage of separability, associativity, commutativity, and symmetry. Give the final answer as another array of numbers, but use symmetry to reduce writing if you like.

Problem 2: Graphics Pipeline (25 pts)

Consider an eye-space triangle whose vertices have the following positions, normals, and texture coordinates assocated with them:

a: position (0. 4 , 0. 2 , −2), normal (− 0. 5 , − 0. 3 , 1), texcoord (0, 0)

b: position (1. 75 , 0. 25 , − 2 .5), normal (0. 5 , − 0. 3 , 1), texcoord (0. 8 , 0 .4)

c: position (0. 6 , 1. 5 , −3), normal (− 0. 5 , 0. 5 , 1), texcoord (0. 3 , 0 .9)

The camera’s field of view is 90 degrees horizontally and vertically, and the near and far distances are 1 and 5. The image is 20 by 20 pixels. This means the projection and viewport matrices are:

Mp =

 Mv^ =

(You may not need all this information, but it may be handy in checking answers.) Here is how the triangle looks in screen space:

12

14

a b

c

  1. What are the clip space coordinates of the vertices before and after the perspective divide?
  2. Assuming the vertex processor hands a screen space position, a normal, and a texture coordinate to the rasterizer, how many quantities will the rasterizer interpolate (in- ternally), and what do they all represent? Assume the rasterizer uses the barycentric coordinates β and γ (leaving α implied) for inside/outside testing and that the frag- ment processor will finish up perspective correction. Normals are to be interpolated without perspective correction.
  3. What are the values at the three vertices from which the rasterizer will interpolate each of these quantities?

Problem 4: Splines (25 pts)

A B´ezier spline with the control points (1, 0), (1, 2), (2, 1), (0, 1) will form a cusp, as shown here on the left:

2

2

0 1

1

(^0 )

1

(^0) β

α

  1. Sketch plots of the coordinate functions x(t) and y(t) and their derivatives. Explain how you can tell that the cusp happens by loooking at these plots.
  2. What are the parametric (Ck) continuity and geometric (Gk) continuity at the cusp?

Let the lengths of the first and last segments of the control polygon be α and β, as shown at right in the figure above. We have seen that a cusp forms when α = β = 2, but for many other values of α it is also possible to find a β for which a cusp will form.

  1. Let tx and ty be the values of t at which x′(t) = 0 and y′(t) = 0 respectively. Find an expression for tx as a function of β.
  2. Use a simple symmetry argument to get ty as a function of α, and then use your two functions to eliminate t and find β as a function of α.

Hint: Three easy ways to check your answer: (a) make sure it works for α = 2; (b) by symmetry, swapping α and β will preserve the cusp; (c) the right-hand diagram is to scale.

Problem 5: Triangle Meshes (15 pts)

Consider the indexed triangle set defined by the vertex list [(–1, –1, –1) (–1, –1, 1) (1, –1,

  1. (1, –1, –1) (0, 1, 0)] and the triangle list [0 2 1, 0 2 3, 0 2 4, 4 0 1, 4 1 2, 4 2 3, 4 3 0].
  1. What is the shape described?
  2. As it stands this is not a manifold mesh. What two changes are required to make it into a manifold mesh?
  3. Express the manifold mesh using a single triangle strip.