ECSE-4750 Computer Graphics, Rensselaer Polytechnic Institute, WR Franklin, Final Exam, 15 Dec 2014

 


NAME: ___W. Randolph Franklin solutions



EMAIL:__________________________ RIN:__________________________




TOTAL: ___________/140


  • There are 35 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 10 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. ________ If a=(5,1,2) then write {$(a\cdot p)\, a$} as a matrix M, depending only on {$a$}, times {$p$}.
    {$ \begin{pmatrix} 25& 5 & 10 \\ 5 & 1 & 2 \\ 10 & 2 & 4 \end{pmatrix} $}
  2. ________ Why can the following not possibly be a 3D Cartesian rotation matrix? {$ \begin{pmatrix} 2& 0 &0\\1 & 0 &0\\0& 0 &2\end{pmatrix} $}
    Any of the following suffice: The determinant is not 1. No column's length is 1. The columns are not perpendicular.
  3. ________ Consider a 3D triangle with vertices (1,2,3), (5,0,1), (0,2,0). What is the z value of the point in the triangle with x=0, y=1?
    The equation of the plane is 3x+7y-z=14. So z= -7.
  4. ________ Name the effect which accentuates the visibility of the common edge between two adjacent bands of slightly different brightness.
    The Mach band effect.
  5. ________ In the graphics pipeline, when a triangle is processed, the (x,y,z) coordinates of the vertices are interpolated across the whole triangle to give the coordinates of each fragment. Name two other things that may commonly be specified at the vertices and then interpolated across the triangle to give a value for each fragment.
    Colors. Normals. Texture coordinates.
  6. ______ Before memory was cheap enough for depth buffers to be practical, one hidden surface technique involved sorting the objects by distance and then drawing them into the color buffer back-to-front. Name this method.
    The painter's algorithm.
  7. _______ What is this technique in shader programs called: p.xyzw = q.wyzx
    Swizzling.
  8. _______ Can the standard OpenGL pipeline easily handle light scattering from object to object? Why (not)?
    No, because it processes objects independently from each other.
  9. ________ What is the quaternion for a 90 degree rotation about the X axis?
    q = cos(45) + sin(45) i = .7 + .7i
  10. _______ Write the equations for the following projection: The camera is at (0,0,0). The projection plane is x+y+z=4. Use cartesian coordinates. In other words tell me what the general point {$(x_0 , y_0 , z_0 ) $} projects to.
    The point will scale by {$ \frac{4}{x_0 + y_0 + z_0} $}. {$ x_0 \rightarrow \frac{4}{x_0 + y_0 + z_0} x_0 $}. {$ y_0 \rightarrow \frac{4}{x_0 + y_0 + z_0} y_0 $}. {$ z_0 \rightarrow \frac{4}{x_0 + y_0 + z_0} z_0 $}.
  11. ________ When texture mapping for a scene with a perspective projection, it is usually not possible to create a single texture map whose texels will be the same size as pixels for all objects in the scene. Why?
    Even if you could compute the appropriate texel size for an object at a certain position, if it moves, as the object's distance from the camera changes, the projected size of the texels will change.
  12. _______ Place these 3 steps in order from earliest to latest.
    • fragment processing
    • rasterizing
    • vertex processing
    vertex processing, rasterizing, fragment processing.
  13. _______ In a shader, what is the difference between a uniform variable and a varying variable?
    From https://www.opengl.org/wiki/Uniform_%28GLSL%29: A uniform is a global GLSL variable declared with the "uniform" storage qualifier. These act as parameters that the user of a shader program can pass to that program. ... Uniforms are so named because they do not change from one execution of a shader program to the next within a particular rendering call. This makes them unlike shader stage inputs and outputs, which are often different for each invocation of a program stage.
    From https://www.opengl.org/sdk/docs/tutorials/ClockworkCoders/varying.php: Varying variables provide an interface between Vertex and Fragment Shader. Vertex Shaders compute values per vertex and fragment shaders compute values per fragment. If you define a varying variable in a vertex shader, its value will be interpolated (perspective-correct) over the primitive being rendered and you can access the interpolated value in the fragment shader.
  14. ______ Designers usually use Bezier curves, where the curve goes near (but not through) the interior control points. They do not usually use Catmull-Rom curves, where the curve goes through all the control points. Why?
    In that case, the curve would be forced to swing widely outside the convex hull of the control points by an unintuitive amount (or else have a sharp bend). It was considered preferable to keep the curve smooth and inside the control polygon but have it not go through the interior control points.
  15. ______ Give 3 reasons why we usually use a sequence of low-degree curves instead of one high degree curve.
    (These answers overlap; other answers are ok.) Local control. More intuitive relation between the control points and the curve. Less roundoff error during the computation. Better numerical conditioning in the solution equation - small changes in coefficients cause small changes in the curve. The higher degree curve doesn't give you any new capability.
  16. ______ Define local control.
    One control point affects only a local part of the spline near it. Distant parts of the spline are not affected. They are affected only by the control points near them. In contrast, if you interpolate one polynomial through a set of points, then changing any point completely changes the entire polynomial.
  17. ______ Aliasing becomes a problem when objects are what compared to a pixel's size?
    1. smaller
    2. larger
    3. the same
    4. The pixel size is irrelevant; aliasing happens when objects are all the same size.
  18. ______ 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.
  19. ______ What is a bumpmap, and why is it useful?
    A texture is used to perturb the normal at each pixel of a polygon. The perturbed normal is input to the lighting equation. This is a cheap way to emulate small 3D relief on the polygon.
  20. ______ In this code to compute diffuse lighting:
    float intensity = max(0.0, dot(N, normalize(L)));
    what's the point of max?
    It keeps the surface's brightness from going negative when the light is behind the polygon.
  21. ______ When I write C code to multiply a vector and a matrix, I probably write a for loop. However, in shaders you see simply this:
    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
    Why don't you write a loop there?
    GLSL overloads operators like * for matrices and vectors. You could use a loop but it would probably be slower.
  22. ______ Why are Euler angles not recommended for animating rotations?
    Smooth changes in the Euler angles cause nonsmooth changes in the object's orientation.
  23. ______ Given a sphere of radius one, what's the normal to the surface at the point (3/13, 4/13, 12/13)?
    A sphere's normals point straight out, so (3/13, 4/13, 12/13). Note that its length is already 1.
  24. ______ Describe a type of scene better suited for processing with radiosity than with ray tracing.
    Surfaces that reflect light onto each other diffusely.
  25. ______ What advantage does a cubic spline have over a quadratic spline?
    A cubic Bezier twists through space and is not confined to one plane. It's impossible to simulate that effect with a spline of planar, i.e., quadratic, pieces. Also, you can match curvature at the joint.
  26. ______ What type of light and surface specially handles a light source that is just above the horizon, compared to a light that is high up.
    Diffuse.
  27. ______ How would you make a spline that does not have a continuous tangent at a joint?
    Bunch up the control points. Three overlapping control points will make the tangent discontinuous at that joint, for a piecewise cubic spline.
  28. ______ Why do you need to clip away stuff that is behind the camera? I.e., what's especially bad about this stuff as opposed to stuff that is just outside the clip region?
    That stuff, which should be invisible, will project mixed in with stuff in front of the camera.
  29. ______ Why is the normalization transformation useful?
    It makes the clip volume to be a cube, and the projection to be straight down, which are easier to work with.
  30. ______ What's a mipmap and what's it good for?
    A pyramid of coarser and coarser texture maps, computed from the input hi-res texture map. Therefore it's easier to find a level whose texels are closer to the pixel size.
  31. ______ Why is 3D clipping usually implemented with six stages of a viewing pipeline?
    Each stage clips one side of the viewing cube. Breaking up the clipping operation like this makes it easier to implement.
  32. ______ What does this do:
    gl.vertexAttribPointer( vNormal, 3, gl.FLOAT, false, 0, 0 );
    Declare that the current buffer contains 3 floats per vertex.
  33. ______ What does this do:
    gl.bufferData( gl.ARRAY_BUFFER, flatten(normalsArray), gl.STATIC_DRAW );
    Write a array of normals, flattened to remove metadata, into the current buffer.
  34. ______ In the previous question, what does flatten mean?
    A 2D Javascript array has other data besides the array elements, such as its size. Flatten converts the array to a simple list of floats w/o any of this metadata. (Therefore the callee has to know the array size.)
  35. ______ What causes some people to be tetrachromats?
    For females, the two X chromasomes for the green retina cones are different, so they have two, slightly different, green cones. They can see four primaries: red, green-1, green-2, blue.

END