Home | | Syllabus | | Assignments | | Documentation

    Exam 2 Review Problems--Solutions

    Here are partial solutions for the review problems. You can check your answers with them.


    Problem 1:
    Consider the 3D object defined by the following 4 vertices:

    P0 = (0,0,1), P1 = (0,0,3), P2 = (4, 0, 1), P3 = (0,3,1)

    The four faces are defined by the triangles formed by all possible groups of the three of these vertices.

    Part a. Find the surface normal for each of the four faces of the object. Normalize the length of the normals to length 1.0.

    Normal for surface defined by P0, P1, P2 = (0, -1, 0)
    Normal for surface defined by P0, P1, P3 = (-1, 0, 0)
    Normal for surface defined by P0, P2, P3 = (0, 0, -1)
    Normal for surface defined by P1, P2, P3 = (3/sqrt(61), 4/sqrt(61), 6/sqrt(61)) = (0.38, 0.51, 0.77)

    Part b. Suppose you want to shade this object using Gouraud shading. Calculate the normals that would be associated with each vertex for this type of shading.

    The normal for the vertex is calcuated as the sum of the normals for each face meeting at the edge, divided by the length of that sum.

    For the point P0, this gives: (-1/sqrt(3), -1/sqrt(3), -1/sqrt(3))

    For the point P1, this gives: (-0.62/1.1, -0.49/1.1, .77/1.1) = (-.56, -.44, 0.698)


    Problem 2:
    Assume you are given the pyramid defined by the following five vertices:

    The base is defined by: (0,0,200), (0,0,100), (100,0,100), (100,0,200)
    The tip is defined by: (50, 150, 150)

    Part a: What set of 3D transformations would move the pyramid to a position defined by the following coordinates:

    The base is defined by: (100,0,0), (200, 0,0), (200, -100, 0), (100, -100, 0) (Not necessarily in the same order as the above specification).
    The tip is defined by: (150, -50, 150).

    The following transformations will work:
    First, Translate the object: T(100, 0, -100)
    Second, Rotate the object by 90 degrees about the X axis: Rx(90)
    This can be embodied in the transformation matrix: M = Rx(90)T(100, 0, -100)

    Part b:Draw the final position of the pyramid that results from applying the following sequence of transformations:

    T(-50, 0, -150)

    S(2.0, 2.0, 2.0)

    Ry(45.0) (Note this was intended so that the Translation was actually done first, so M = RyST)

    The base is defined by: (0,0, 100*sqrt(2)), (100*sqrt(2), 0, 0), (0,0,-100*sqrt(2)), (-100*sqrt(2), 0, 0)
    The tip is defined by: (0, 300, 0)


    Problem 3:
    Suppose you are given a pyramid defined by the following 5 vertices:

    The Base is defined by: (100, 200, 200), (100, 100, 200), (200, 100, 200), (200, 200, 200)
    The tip is defined by: (150, 150, 100)

    Part a: Suppose the pyramid is projected onto a 2-D projection plane that coincides with the XY plane. Assuming orthographic projection is used, defive the (x,y) coordinates of each of the five vertices onto this projection plane.

    In the order specified above:

    P0 = (100, 200)
    P1 = (100, 100)
    P2 = (200, 100)
    P3 = (200, 200)
    P4 = (150,150)

    Part b: Now assume that perspective projection is used and that the center of projection is at the origin of the coordinate system and the projection plane is a distance of 10 from the origin along the Z axis (and parallel to the XY plane). Derive the (x,y) coordinates of the projections of each of the five vertices onto the projection plane.

    xprime = x/(z/d); yprime = y/(z/d)

    In the order specified above:

    P0 = (5,10)
    P1 = (5, 5)
    P2 = (10, 5)
    P3 = (10,10)
    P4 = (15,15)


    Problem 4:
    Suppose you have a light source that is positioned at an angle of 45 degrees from the normal vector of a surface. Assume you have the following parameters for the light source and the material reflection properties:

      kd = 0.5
      ka = 0.5
      Ld = 1000
      La = 100
      Ls = ks = 0
      d (distance to light source) = 10
      Attenuation coeeficients: a = 0, b = 0.1, c = 0.09

    Calculate the intensity of the light reflected from the surface according to the Phong reflection model. How would this intensity change if the angle between N and L were decreased? How would it change if kd were increased?

    I = (1/(a + bd + cd*d))(kdLd(l . n)) + kaLa = (1/(1 + 9))(500(1/sqrt(2))) + 50 = 50(1 + 1/sqrt(2))

    The light intensity increases as the angle between N and L decreases.

    The light intensity increases as kd increases.


    Home | | Syllabus | | Assignments | | Documentation


    Constance Royden--croyden@mathcs.holycross.edu
    Computer Science 384, Computer Graphics
    Date Created: August 17, 1999
    Last Modified: August 15, 2001
    Page Expires: August 17, 2002