CMSI 371/671
Homework #2

Read the chapters 6-9 and appendices A, B, F and G in the OpenGL red book. Most of it should be read somewhat carefully, with the exception of the sections on polygon offset and antialiasing, both of which can be skimmed. You can also skim chapters 10-12 if you have time.

  1. Describe the effect of the scaling transformation S(-1,1).

  2. The figure ABCD where A=(-2,0), B=(0,-2), C=(-2,-4) and D=(-4,-2) can be transformed into A'B'C'D' where A'=(1,-1), B'=(3,3), C'=(6,3) and D'=(4,-1) by the composition of simple transforms T2*H1*S1*R1*T1. Give the matrix form of these five transformations. Then express the composite transform using only one scale, one rotation and one translation.

  3. Let P = (2, 0, -5) and Q = (3, 3, 4). Suppose the projection matrix has been modified with
        glLoadIdentity();
        gluPerspective(90.0, 1.0, 2.0, 10.0);
    and that the modelview matrix is unchanged from its default setting. To which points (in normalized device coordinates) are P and Q transformed? Show your work by first indicating the frustum produced by the gluPerspective() call.

  4. What is the functional form of the line passing through (1,4,-3) and (-2,1,7)?

  5. To what point is (7,8) transformed when the coordinate system is rotated 82 degrees counterclockwise?

  6. What happens when you set the distance to the near clipping plane to zero in a call to glFrustum? Explain your answer both spatially, with a sketch, and algebraically, by referencing the matrix produced by glFrustum.

  7. Write a function to determine whether a given two-dimensional affine transformation is contractive. An affine transformation A is contractive if and only if for all points P and Q, such that P is not equal to Q, Length(PQ) > Length(A(P)A(Q)). In other words, for all non-zero line segments L, L is strictly longer than A(L).

  8. Write a procedure to display the result of applying to the polygon (-0.4,-0.4)--(0.7,-0.4)--(0.7,0.2)--(0.15,1.0)--(-0.4,0.2) the transformation

        λ(x,y).(x/2 + x*x/1.8 + y/5 + 0.3, y/2 + x*y/1.7 + 0.3)

    Make sure your result is accurate to within the pixel resolution.

  9. Recall that the Triadic von Koch Curve is produced by the L-System

        Axiom F
        Rule  F -> F+F--F+F
        Angle π/3.

    Consider the family of curves {C(a) | 0 <= a < = π} with the same Axiom and Rule but with variable angle a.

    1. Give the fractal dimension of the curve C(a), as a function of a, of course.

    2. Use your answer in part (a) to compute the dimension of the curves C(0), C(π/2), and C(π). Explain these results geometrically using sketches of the first few steps in the developments of each of these curves.