CG ECSE-4750 Computer Graphics Midterm, RPI, Thurs 2016-10-13
Name, RCSID:
. .
Rules:
- You have 60 minutes.
- You may bring in one 2-sided 8.5"x11" paper with notes.
- You may not share material with each other during the exam.
- No collaboration or communication (except with the staff) is allowed.
- There are 20 questions. Check that your copy of this test has all the pages.
-
(2 pts) If you wanted to change all the vertex positions by multiplying each x-coordinate by the same vertex's y-coordinate, the best place to do it is:
- with a javascript function
- in the vertex shader
- in the fragment shader
- in the html file
- it can't be done.
. .
-
(2 pts) Put these graphics pipeline components in the correct order:
- fragment-shader
- primitive-assembly
- rasterizer
- vertex-shader
. .
-
(2 pts) Name an advantage and a disadvantage of standards.
. .
-
(2 pts) If you do not tell OpenGL to do hidden surface removal, and two objects overlap the same pixel, then what color is that pixel?
- OpenGL throws an error.
- the closer object
- the farther object
- the first object to be drawn there
- the last object to be drawn there
. .
-
(2 pts) If i and j are quaternions, what is (i+j)(1+j)?
. .
-
(2 pts) Adding (1+2i) to the complex representation of the point (x,y) is equivalent to doing what to it?
. .
-
(2 pts) What is the quaternion for the rotation around the axis \(\left(\frac{3}{13}, \frac{4}{13}, \frac{12}{13}\right)\) by 180 degrees?
. .
-
(2 pts) How would you best send the location of a global light source to the vertex shader?
- as a varying variable.
- as a uniform variable.
- in another array similar to the vertex array.
- with a bindBuffer call.
- as an attribute.
. .
-
(2 pts) Why can the following not possibly be a 3D Cartesian rotation matrix?
\(\begin{pmatrix} 1& 0 &1\\1 & 0 &0\\0& 0 &1\end{pmatrix}\)
. .
-
(2 pts) Name the 2 types of shaders that every WebGL program must have.
. .
-
(2 pts) What is the CIE chromaticity diagram good for?
. .
-
(2 pts) What hardware advance made raster graphics possible?
. .
-
(2 pts) What method of doing rotation suffers from gimbal lock?
. .
-
(2 pts) Describe how to implement picking.
. .
-
(2 pts) What is the purpose of gl-canvas in this line of code:
canvas = document.getElementById( "gl-canvas" );
. .
-
(2 pts) What does this line of code do:
gl.viewport( 0, 0, canvas.width, canvas.height );
. .
-
(2 pts) What does this line of code do:
window.requestAnimFrame(render);
. .
-
(2 pts) Name 2 things that this does:
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, iBuffer);
. .
-
(2 pts) What is the purpose of vPosition in this line of code?
var vPosition = gl.getAttribLocation( program, "vPosition" );
. .
-
(2 pts) Suppose that your vertex shader computed some property of each vertex and wanted the rasterizer to compute a weighted value of that property for each fragment. What type of variable would your vertex shader store that property in?
. .
End of midterm