W Randolph Franklin home page
... (old version)
ComputerGraphicsFall2013/ home page Login


ECSE-4750 Computer Graphics, Rensselaer Polytechnic Institute, Midterm Exam, Fall 2013, 10 Oct 2012 4-5:30

NAME: ________WRF____________________________ EMAIL:_______mail@wrfranklin.org________________ RIN:______________

Answers in BLUE

There are 5 pages with 20 questions, each worth 2 points. Answer every question but 2. You may write FREE as the answer for two questions (and get the 2 points each).

Please sit in alternate seats, counting in from, and starting next to, the outside walls.

This exam is closed book: you may use calculators and one 2-sided letter-size note sheet that you brought with you. You may not use computers or communication devices, or share material with other students.

  1. _____/(2 points) What display technology depends on the ability of an electric field to straighten out a corkscrew molecule?
    Liquid Crystal Display, LCD
  2. ________/2 Why can the following not possibly be a 3D Cartesian rotation matrix?
    {$ \begin{pmatrix} 1& 0 &0\\1 & 0 &0\\0& 0 &1\end{pmatrix} $}
    There are several possible answers; you need give only one of them. The 1st column does not have the required length of 1. Ditto the 2nd column. The 1st two columns are not perpendicular to each other. The determinant is not 1. Etc.
  3. ________/2 If a=(1,2,3) then write {$(a\cdot p)\, a$} as a matrix M, depending only on {$a$}, times {$p$}.
    {$ M = \begin{pmatrix} 1&2&3\\2&4&6\\3&6&9\end{pmatrix} $}
    {$(a\cdot p)\, a = M p$}
  4. ______/2 Can the volume of a small cube change when its vertices are rotated? (yes or no). Why (not)?
    No because a rotation is a rigid transformation, which preserves lengths, and so must also preserve volumes.
  5. _____/2 What does this do:
    glutDisplayFunc(display)
    It registers display as the callback function to display the window.
  6. _____/2 One problem with putting all your vertices into an array is that each vertex might be a member of a variable containing other info, such as this:
      Class Vert {
      public:
      float coords[3];
      float color[4];
      float normal[3];
      }
      Vert verts[10];
    
    
    Therefore the coordinates of successive vertices are not adjacent. How can you tell OpenGL about that when using a vertex array? You don't need to give the precise syntax in you can describe the idea or give the key word describing this.
    The relevant word is stride, which expresses the distance between the start of one vertex and the start of the next vertex. The element array routines have an argument for you to give the stride. As a special case, giving 0 means there is nothing else between adjacent vertices.
  7. _____/2 What does glFlush do?
    It forces OpenGL to flush the pipeline and display all the graphics stuff that's been executed to date. Otherwise, stuff may sit in the pipeline for awhile.
  8. _____/2 Use the vector formulation or your intuition to rotate the point (0,2,2) by 60 degrees about the axis (0,1,1).
    Intuition is easier. Since the point is on the axis, rotating it doesn't move it. The answer is (0,2,2).
  9. ____/2 What's the dot product of these 2 vectors: (1,2,3), (4,5,6)?
    32.
  10. ____/2 When are glPushMatrix() and glPopMatrix() useful?
    When you want to do a temporary change to a matrix, and then unwind it. A common use is for nested or hierarchical transformations in animation.
  11. ____/2 What feature in OpenGL is used to display the closest object when several objects overlap the same pixel?
    The Z buffer.
  12. ____/2 Consider this sequence of calls:
      glColor3f(1.,1.,1.);
      glColor3f(0.,1.,0.);\
      glVertex3f(1.,1.,1.);
      glVertex3f(2.,2.,2.);
    
    
    1. What color is the vertex (1,1,1)?
      Green. Later color calls override earlier ones, and the last one before the vertex is what matters.
    2. What color is the vertex (2,2,2)?
      Green.
  13. ____/2 Why do we like to group different physical input devices into the same logical input device?
    It's an abstract that makes the program more portable. Your program probably doesn't care about the physical details, but only about the type of input (text, screen location, etc).
  14. ____/2 Here's how picking might have been implemented: When you pick an object, the line number of the glBegin call to draw the closest object covering that pixel might be returned by the pick routine.
    Why would this idea be inadequate?
    That line of code may be in a loop in a subroutine called from several places. Each of those calls might generate a different object, which are not distinguished by merely the line number.
  15. _____/2 What's the quaternion representing a rotation of 180 degrees about the axis (1,0,0)?
    {$ \cos(\theta/2)=0 $} so q = i
  16. _____/2 What 3 simpler operations would you combine to rotate an object by 90 degrees around the point (1,2,3) about the axis (1,0,0)? That is, the axis does not go through the origin, but goes through the point (1,2,3).
    Translate by (-1,-2,-3), rotate by 90 about the axis (1,2,3), finally ttranslate by (1,2,3). It's sufficient to say to translate a point on the axis to the origin, rotate about the axis, then translate back.
  17. _____/2 When rendering a triangle, you are given various properties at each vertex, and then need to interpolate them at each pixel inside the triangle. One such property is position. Name two other properties.
    Color, surface normal.
  18. _____/2 Here is a 3D homogeneous point: (1,2,3,4). What Cartesian point does it correspond to?
    (1/4, 2/4, 3/4)
  19. _____/2 Give the 4x4 homogeneous matrix for a rotation by 90 degrees about the Z axis.
    {$ \begin{pmatrix} 0&-1&0&0\\1&0&0&0\\0&0&1&0\\0&0&0&1\end{pmatrix} $}
  20. _____/2 Suppose that you're writing a spacewar game, where there are 10000 asteroids that your spacecraft might hit. (To make this question simple) The asteroids are not moving. Repeatedly testing for a collision between your spacecraft and each asteroid is too slow. How can you make this faster (w/o using faster hardware)?
    Use some sort of spatial data structure. Examples include octree or uniform grid.

end of exam