ECSE-4750 Computer Graphics, Rensselaer Polytechnic Institute, Final Exam B, 12 Dec 2013

 


NAME: _______________________________________________EMAIL:__________________________ RIN:_________________________________





TOTAL: ___________/160


  • There are 40 questions. Answer them all. However, you may write free as the correct answer to any two questions.
  • Each question is worth 4 points.
  • There are 11 pages.
  • This exam is closed book; you may have two 2-sided letter-size note sheets. You may not use computers or communication devices, or share material with other students.


  1. ________ Does projection preserve angles? Justify your answer.








  2. ________ When using 2D homogeneous coordinates, at what point do the lines x+y+w=0 and x+2y+3w=0 intersect?








  3. ________ Consider the triangle with Cartesian vertices (0,0,0), (1,0,0),(0,1,1). What is the normal to its surface? Your answer must be normalized.








  4. ________ Here is a 2D homogeneous transformation matrix. Prove that it is, or is not, a rotation. If it is, then what is the angle of rotation?
    {$ \begin{pmatrix} 0 & -4 & 0 \\ 4 & 0 & 0 \\ 0 & 0 & 4 \end{pmatrix} $}








  5. ________ Assume that one rotation is expressed as the quaternion j and that a 2nd rotation is the quaternion k. What is the quaternion for those two rotations in order combined?








  6. ________ What is its axis and angle?








  7. ________ Suppose that you want to move a robot arm along a path that is a spline curve. What is wrong with using a piecewise quadratic spline? Saying, "the curve looks bad", is not informative enough.










    Consider these 4 types of lighting:
    • user-specified color at each vertex.    y         /       n,    y         /       n

    • user-specified ambient lights with ambient material colors.    y         /       n,    y         /       n

    • user-specified diffuse lights with diffuse material colors.    y         /       n,    y         /       n

    • user-specified specular lights with specular material colors.    y         /       n,    y         /       n

  8. ______ For each of those say whether the color changes when only the light moves, by circling y or n in the first y / n group above.


  9. ______ For each of those say whether the color changes when only the camera moves, by marking the 2nd y / n group.


    Look at this shader program:
      uniform vec3 lightPos[3];
    varying vec3 N, L[3];
    
    void main(void)
    {
        // vertex MVP transform
        gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
    
        vec4 V = gl_ModelViewMatrix * gl_Vertex;
    
        // eye-space normal
        N = gl_NormalMatrix * gl_Normal;
    
        // Light vectors
        for (int i = 0; i < 3; i++)
            L[i] = lightPos[i] - V.xyz;
    
        // Copy the primary color
        gl_FrontColor = gl_Color;
    }
    
    
  10. ________ Is this a vertex shader or a fragment shader?








  11. ________ Where does the variable gl_Vertex get its value?








  12. ________ Where does the variable lightPos get its value?








  13. ________ Who uses the value of variable N after this shader finishes?








  14. _______ In a shader, what does this code do: v.yxzw = v.xyzw ?








  15. ______ Imagine a 2-D quadratric Cartesian Bezier curve with control points P0(0,0), P1(1,0), P2(0,1). What are the points on the curve with t=0, t=1/2, t=1?












  16. ______ Imagine a 2-D quadratric Cartesian Bezier curve with control points P0(0,0), P1(1,0), P2(0,1). Imagine that you are joining a 2nd Bezier curve to the end of this one, so that there is C1 continuity at the joint. What are the 1st and 2nd control points of this new curve?












  17. ______ How many degrees of freedom would a 3D cubic homogeneous Bezier patch have?












  18. ______ Give 3 reasons why we usually use a sequence of low-degree curves instead of one high degree curve.












  19. ______ Give 1 reason why we use parametric curves instead of explicit curves.












  20. ______ What does the word Rational in NURBS mean?










  21. ______ An evaluator is often used to generate vertex positions. Name 3 other things an evaluator might generate.












  22. ______ A material's color is represented by 10 numbers. Name them.












  23. ______ What coordinate system do you define a trim line in?












  24. ______ The Bresenham line algorithm was devised to operate efficiently with (or without) what property of hardware?












  25. ______ What might clipping do to the number of vertices?
    1. The number of vertices might stay the same or reduce but not grow.


    2. The number of vertices might stay the same or grow but not reduce.


    3. The number of vertices might stay the same or grow or reduce.


    4. The number of vertices must stay the same.






  26. ______ What is a texture sampler, and how is it more powerful than an array?












  27. ______ If you want to create a highlight in the middle of a triangle, can you do that by computing the color at each vertex and interpolating (rastering) the color across the triangle? Justify your answer.












  28. ______ What happened to immediate mode in the current OpenGL? Why?












  29. ______ What does Primitive Assembly mean?












  30. ______ What does this do: glBindBuffer(GL_ARRAY_BUFFER, buffer[VERTICES]);












  31. ______ glWhat does this do: BufferData(GL_ARRAY_BUFFER, sizeof(vertices) + sizeof(colors), NULL, GL_STATIC_DRAW);












  32. ______ What does this do: glLinkProgram(programId);












  33. ______ What does this do: glEnableClientState(GL_VERTEX_ARRAY);












  34. ______ What does this do: glColorPointer(3, GL_FLOAT, 0, colors);












  35. ______ What does this do: glMatrixMode(GL_MODELVIEW);












  36. ______ What does this do: glClearColor(1.0, 1.0, 1.0, 0.0);












  37. ______ What does this do: glDrawElements(GL_TRIANGLE_STRIP, 10, GL_UNSIGNED_INT, stripIndices);












  38. ______ What does this do: programId = glCreateProgram();












  39. ______ Why is it inefficient to do computations in the display routine that could be done at initialization time.












  40. ______ What does this do:
    <body onload="webGLStart(); resizeCanvas(600); flipAnim()">













END