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.

3D Transforms

  1. A triangle is defined by the following vertices:

    (A) Find the outward pointing unit normal of this triangle. Recall that vertices are numbered by convention in the counterclockwise direction when seen from the outside of a surface. Check your work by testing that the dot product of the normal with the vector along any edge of the triangle is zero.

    (B) Find the angle between vectors q=(v2-v1) and r=(v3-v1).

    (C) Derive the equation for the plane defined by this triangle.

  2. Given the plane 3x+y-7z+2=0

    (A)Find the projection Q of point P=[1 2 3 1]T onto this plane.

    (B)Use the plane equation to check that Q is on the plane.

    (C)Check that vector P-Q is in the direction of the plane normal.

  3. You are placing furniture in a 20' by 20' room. The coordinate system for the room is fixed in the SE corner, on the floor. The x-axis runs in the N direction, and the y-axis runs in the W direction. The z-axis is up. A couch and a door, with local coordinate frames shown, are to be placed in the room.

    (A) Find the transform to place the sofa in the center of the N wall.

    (B) Find the transforms to place double doors in the center of the E wall. Place the doors so that they are opening inward at a 30 degree angle.

  4. In class, we identified the SHxy(shx,shy) matrix, which shears by shx in the x direction and by shy in the y direction, proportional to the z coordinate. Derive the corresponding matrices SHyz(shy,shz) and SHxz(shx,shz).
  5. Given a unit cube with one corner at [0 0 0 1]T and the opposite corner at [1 1 1 1]T, derive the transformations necessary to rotate the cube by theta about the main diagonal (from [0 0 0 1]T to [1 1 1 1]T) in the counterclockwise direction when looking along the diagonal toward the origin. You might want to find a physical cube to help visualize this transformation. Test your transform by checking the rotation of point [1 0 0 1]T about the diagonal by angle 2pi/3.

Projection

  1. You are standing in the center of a 20'x20'x10' room looking out a large 6'x6' window centered on the North wall. Your eye level is at a height of 6'. Your view is blocked by a skyscraper 100' outside the window. The world coordinate system (WC) is anchored at the SE corner of the room. The WC x-axis points to the North, and the WC y-axis points to the West.

    (A)Find the view volume parameters for the portion of 3D space that you can see that falls outside the window. Use the proper coordinate frame (WC or VRC) for each parameter.

    (B) You move to the SE corner of the room. Which parameters change? (You still can't see past that skyscraper.)

  2. The animation lab uses a standard "quarter shot" to present basic demonstrations of motion. The image below is one example. Assume that the runner is 6' tall. The world coordinate system is anchored on the ground below the runner center of mass, with:
    x-axis in the direction of motion,
    y-axis in the direction to the runner's left,
    z-axis up.

    Estimate a set of view volume parameters to obtain this shot. Explain your choices.


Projection and Clipping

  1. You are given a line segment with endpoints:
    A = [1 1 1 1]T
    B = [-1 -0.5 -2 1]T

    Trace through the Cohen-Sutherland clipping algorithm for a 3D perspective projection canonical view volume. Find the endpoints of the clipped line segment using the parametric line equation.


Visible Surface Algorithms

  1. 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

    (A)The viewpoint is at the origin. Trace the steps required to determine whether this is a front-facing or back-facing polygon. Assume that the vertices appear to be numbered in counterclockwise order when the front-facing surface is visible.

    (B)How does your answer change if the viewpoint is at point V instead of at the origin:

    V = [1 3 2 1]T

  2. You have three polygons to scan convert onto a 4 x 4 pixel display. Depth and color information for each of the polygons is shown below. Trace the contents of the frame buffer and z-buffer as the z-buffer algorithm is used to scan convert these polygons. The background color is black (K). The minimum depth value is -7.