Solution ECSE-4750 Computer Graphics CG class 16 and Midterm, RPI, Thurs 2019-10-17
Name, RCSID: WRF Solution
Rules:
- You have 80 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 25 questions. Check that your copy of this test has all six pages.
- If you need more space, use the back of another page, and write a note in the original space to tell us.
-
(2 pts) If you had 1,000,000 vertices and wanted to change all the vertex positions by multiplying each x-coordinate by the same vertex's y-coordinate, the fastest 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) Color printing on a sheet of paper exemplifies
- additive color
- subtractive color
- multiplicative color
- divisive color
- exponential color
-
(2 pts) Major components of the WebGl model as discussed in class are:
- Objects, viewer, light sources, planets, material attributes.
- Still cameras, video cameras, objects, light sources.
- Objects, viewer, light sources, material attributes.
- Colored objects, black and white objects, white lights, colored lights
- Flat objects, curved objects, near lights, distant lights.
-
(2 pts) In the graphics pipeline, the step after rasterizing is the
- vertex shader
- primitive assembler
- fragment shader
- tesselation shader
- javascript callback
-
(2 pts) Double buffering solves which problem:
- producing stereo images
- low memory bandwidth
- remote debugging PCs
- displaying from a frame buffer while it's being updated
- optimizing scheduling two elevators as a group
-
(2 pts) What does this line do:
gl.bindBuffer( gl.ARRAY_BUFFER, vBuffer );
- Create this buffer.
- Enable this buffer so that the shaders will use it.
- Get the address of variable vBuffer.
- Prevent this buffer from being modified.
- Specify that this buffer will be the object of future buffer operations.
-
(2 pts) Which of these curved surface equation types makes it easy to generate points on the surface?
- explicit
- explicit and implicit
- explicit and parametric
- implicit
- parametric
-
(2 pts) How do you draw a pentagon in WebGL?
- Split it into triangles.
- Split it into triangles if it is concave, otherwise draw it directly.
- Split it into triangles if it is convex, otherwise draw it directly.
- Draw it directly.
- Split it into hexagons.
-
(2 pts) In the WebGL pipeline, the Primitive Assembler does what?
- fits together pieces of ancient Sumerian pottery.
- rotates vertices as their coordinate systems change.
- creates lines and polygons from vertices.
- finds the pixels for each polygon.
- reports whether the keyboard and mouse are plugged in correctly.
-
(2 pts) If you do not tell WebGL to do hidden surface removal, and two objects overlap the same pixel, then what color is that pixel?
- WebGL 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) This 3D homogeneous point: (4,3,2,1) corresponds to what Cartesian point:
- (4,3,2,1)
- (4,3,2)
- (3,2,1)
- (3/4, 1/2, 1/4)
- Some point at infinity.
-
(2 pts) Consider an axis a=(0,1,0) and a point p=(2,3,4). What is the component of p that is perpendicular to a?
- (2,3,4)
- (2,0,4)
- (0,3,4)
- (0, 3/5, 4/5)
- (1,0,0)
-
(2 pts) These next few questions are for 2D geometry. What is the 3x3 homogeneous matrix for the perspective projection whose center is at Cartesian (0,0) and whose viewplane is z=2?
Cart: x' = 2x/z, z'=2. Hom: x'=2x, z=2z, w'=z.
\(\begin{pmatrix} 2&0&0 \\ 0&2&0\\ 0&1&0 \end{pmatrix}\)
-
(2 pts) What is the 3x3 homogeneous matrix for the parallel projection whose center is at Cartesian (0,0) and whose viewplane is z=2?
Cart: x' = x, z'=2. Hom: x'=x, z=2w, w'=w.
\(\begin{pmatrix} 1&0&0 \\ 0&0&2\\ 0&0&1 \end{pmatrix}\)
-
(2 pts) When rotating an object, what can happen to an object?
- Straight lines might turn into curves.
- Straight lines stay straight, but angles might change.
- Straight lines stay straight, and angles don't change, but distances may change, either longer or shorter.
- Straight lines stay straight, and angles don't change, but distances might get longer.
- Straight lines stay straight, and angles and distances don't change.
-
(2 pts) Translating the 2D homogeneous point by (2,3,4) by (in Cartesian terms) dx=1, dy=2 gives which new homogeneous point?
- (2,3,4)
- (1,2,3,4)
- (3,5)
- (6,11,4)
- (3,5,4)
-
(2 pts) Rotating the 2D Cartesian point (0,-1) by \(90^o\) gives what:
- (1,0)
- (-1,0)
- (0,1)
- (0,-1)
- (-.7,.7)
-
(2 pts) If a 3x3 rotation matrix has eigenvalues \(1, -\frac{1}{2}+\frac{\sqrt{3}}{2}i, -\frac{1}{2}-\frac{\sqrt{3}}{2}i\), then what is the rotation angle (in degrees)?
Answer \(\cos\theta = -1/2\) so angle = 120 degrees.
-
(2 pts) Give me a matrix M that has this property: for all vectors p, \(Mp = \begin{pmatrix}2 \\ 1 \\ 0\end{pmatrix} \times p\).
Answer \(\begin{pmatrix} 0&0&1 \\ 0&0&-2 \\ -1&2&0 \end{pmatrix}\)
-
(2 pts) What is the angle (in degrees) between these two vectors: (1,2,3), (2,4,6)?
0
-
(2 pts) This is a homogeneous 3D translation matrix: \(\begin{pmatrix} 3&0&0&2\\ 0&3&0&3\\ 0&0&3&4\\ 0&0&0&3 \end{pmatrix}\) Where is the Cartesian point (0,0,0) translated to? Give your result as a Cartesian point.
One way is to divide the whole matrix by 3, which doesn't change its effect. Then you can read the translation off the right column: (2/3, 1, 4/3). So (0,0,0) translates to (2/3, 1, 4/3).
-
(2 pts) What is the purpose of v1 in this line of code?
var v2 = gl.getAttribLocation( program, "v1" );
It's the name of an attribute variable in a shader.
-
(2 pts) You're mixing 3 pure spectral colors: 20% of a color with wavelength 500nm, 40% of 600nm and 40% of 700nm. The result will appear to be one color. What diagram would you use to compute what color this mix would appear to be, to a normal person?
CIE chromaticity diagram
-
(2 pts) If i and j are quaternions, what is ij+ji?
k-k = 0
-
(2 pts) The quaternion k represents what rotation? Give the axis and angle.
180 degrees (pi radians) about the z axis
End of midterm