CS 4390
Computer Graphics

Fall 1998
College of Computing 201
MWF 11:00-12:00


Homework Questions

Most of the lectures will have a few example (homework) questions listed on this page. This homework does not need to be turned in, but similar questions may appear on the quizzes and final exam. Feel free to discuss these problems with other students in the class.

Illumination

  1. Explain the differences between ambient, diffuse, and specular reflection.
  2. This question contains enough information to describe a very simple scene containing two lights and a single triangle. From this scene, using the Phong illumination model, you can determine exactly how to shade this triangle.

    You are given a triangle with endpoints:

    P1 = [1 1 1 1]T
    P2 = [0 2 1 1]T
    P3 = [0 0 1 1]T

    This triangle is a fully saturated red (Od,R = 1), and the specular color is white. The triangle has the following material properties:

    ka = 0.7
    kd = 0.9
    ks = 0.6
    n = 10 (n is the specular reflection exponent)

    You have the following light sources:

    A white ambient light with intensity 0.1.
    A white point light located at [1 1 5 1]T with intensity 0.5.

    The viewer is at point [1 2 5 1]T

    The display has the following characteristics:

    Minimum intensity I0 = 0.005
    Intensity ratio r = 1.021 (i.e. I1 = 1.021 I0)
    There are 8 color bits available for each color.

    (A) Compute the intensity of the ambient reflection at the interior point [0.5 1 1 1]T.

    (B) Compute the intensity of the diffuse reflection at the same point.

    (C) Compute the intensity of the specular reflection at this point.

    (D) Given this intensity information, what color should a pixel at this point be drawn?

    (E) Describe the contribution of the two different light sources.


Shading

  1. What is flat shading?
  2. When would you choose Phong shading over Gouraud shading?
  3. This question builds on your answers from the question #2 in the illumination homework above. Assume that the triangle described there is really an approximation to a curved surface. We could shade the triangle using flat shading, choosing for example, the color computed in part D of question #2 above.

    An alternative would be to use one of the smooth shading techniques. Assume that good estimates for outward pointing unit normal vectors at the vertices P1, P2, and P3 are as follows:

    normP1 = [ 0.30, 0.00, 0.95, 0]T
    normP2 = [ 0.00, 0.50, 0.87, 0]T
    normP3 = [-0.10, -0.10, 0.99, 0]T

    (A) Compute the new color values at each of the three vertices.

    (B) Use Gouraud shading to compute the color of the point [0.5 1 1 1]T. Assume that the triangle projects onto the display without distortion, so that linear interpolation along the triangle surface gives the same results as linear interpolation in the space of the display.

    (C) Use Phong shading to compute the color of the point [0.5 1 1 1]T.

    (D) How do the diffuse and specular components of intensity differ for flat shading, Gouraud shading, and Phong shading?

    (E) Compare the amount of computation required for each type of shading.


Curves

  1. (A)What does it mean for a curve to be C2 continuous?

    (B)Suppose that we want to draw a C2 continuous curve to connect points A and B shown below:

    We know that the endpoints of the curve we wish to draw are A and B. Suppose that we also know all of the derivativess of the curve at those endpoints. In general, can we produce a C2 continuous splice between A and B with a cubic polynomial curve? Why or why not?

    (C)What type of curve would you choose to draw a C1 continuous splice between A and B? Give the value of the geometry vector for this curve.

  2. In class we saw that the tangent vectors used for the Hermite curve could be related to the control points of the Bezier curve using the equations:
    R1 = 3(P2 - P1)
    R2 = 3(P4 - P3)

    Suppose that these equations were of the form:

    R1 = b(P2 - P1)
    R2 = b(P4 - P3)

    For some unknown value b. Now, consider the four equally spaced Bezier points (forming a line segment along the x-axis):

    P1 = (0, 0, 0)
    P2 = (1, 0, 0)
    P3 = (2, 0, 0)
    P4 = (3, 0, 0)

    Show that, for parametric curve Q(t) to have constant velocity from P1 to P4, b must equal 3.


Curves2

  1. Why will it be difficult to use a nonrational, uniform B-spline curve to connect A and B?

  2. For nonrational, uniform B-Splines, we have the expression Qi(t) = TMBsGBs, i, with vectors T, MBs, and GBs, i defined as follows:

    Use this expression for Qi(t) to show that two adjacent curves i and i+1 have C2 continuity at the join point.

  3. Suppose we want to construct a parametric, bicubic surface that is a flat, square patch with corners at the following four (x, y, z) locations:
    (0, 0, 0)
    (1, 0, 0)
    (0, 1, 0)
    (1, 1, 0)

    (A)Derive the geometry vector to construct this patch as a Hermite surface patch. Align parameter s with the x-axis and parameter t with the y-axis.

    (B)What is the geometry vector if we make this a Bezier surface patch?


Object Modeling

  1. What is an octree representation? How does it compare to using a spatial occupancy grid to model an object?
  2. One advantage to an octree or quadtree representation over a surface representation of an object is that constructive solid geometry operations are relatively straightforward and fast to compute.

    (A)Describe an algorithm for doing the union operation for two quadtrees. Be careful to compress nodes when possible to maintain a compact representation of the object.

    (B)Trace the operation of the union algorithm on the two quadtrees below. Draw a sketch of the two objects and their union to test your algorithm.

  3. In class, we defined a simple grammar and saw that the following rewrite rule could be traced through several generations to produce the structure in the images shown.
    Start = F
    F -> F[+F]F[-F]F

    Trace the first few generations of branching structures using the following rewrite rule:

    Start = F
    F -> F[+F][-F[-F][+F]]FF