Q_F06_Midterm1

advertisement
Name:
CMPS 160
Intro to Graphics
Fall 2005
Midterm Exam #1
1. (5 points)
Suppose we want to rotate a sphere located at (3,3,3) around the line connecting (0,0,0)
and (1,1,1). If we rotate the sphere by 45 degrees, what will be its final position?
2. ( 5 points) You bought a graphics card at SuperCheapo.com and it only cost you $9.95.
Unfortunately the z-buffer only works for 50% of the pixels, for the rest it doesn’t do
anything, thus visibility isn’t resolved correctly. You’re broke, but you have plenty of
time to program. What could you do so that you still get usable pictures?
3. (15 points total)
a. (10 points) We’d like to design a new operator for our graphics language which
generates the mirror image of objects across the y=2 line. Lets suppose we are working in
a 2D world, so forget about the z coordinate.
What is the 3x3 homogeneous matrix which will perform this transformation?
b. (5 points) Now suppose we’d like to provide a command GL_MirrorY(y0) to mirror
across an arbitrary y=y0 line. What is the matrix?
4. (10 points) Suppose we have a scene in viewing coordinates as drawn below. That is
we have already transformed the camera to be at the origin looking down the –z axis. All
that remains is to select our camera projection method. In all cases we will select a
projection which keeps all objects within the view frustum.
a. Suppose we use an orthographic projection. What might the rendered picture look like?
b. Suppose we use a perspective projection. What might the rendered picture look like?
c. Suppose we use an oblique perspective projection. What might the rendered picture
look like?
5. (10 points) We have a CRT which can change the electron gun direction at a maximum
rate of 1,000,000 pixels/second. Suppose we have a display which is nominally 1,000 x
1,000 pixel resolution.
a. If this is a raster scan display, how many times per second can we draw a single 10x10
square on the screen?
b. If this is a vector display, how many times per second can we draw a single 10x10
square on the screen?
Now suppose that we need to draw 1,000,000 squares.
c. If this is a raster scan display, how many times per second can we draw all the 10x10
square on the screen?
d. If this is a vector display, how many times per second can we draw all the 10x10
square on the screen?
6. (10 points) Suppose we have a graphics system
that rasterizes polygons by turning on pixels that
are strictly inside the bounds of the polygon. For
example:
a. Suppose we execute the following, which pixels
will be turned on?
glBegin()
glVertex(0,0)
glVertex(6,0)
glVertex(6,6)
glVertex(0,6)
glEnd()
b. Suppose that this system can not rasterize quadrilaterals directly, and instead breaks
them into triangles. What are the vertices of two triangles that would represent this quad?
c. Suppose we now rasterize these two triangles,
which pixels will be turned on?
d. What is wrong with this rasterizer and how might we fix it?
7. (10 points)
a. If we make the call glTranslate(0,1,0), what 4x4 matrix will be multiplied into the
matrix stack?
b. If we make the call gluLookAt(eye=(0,0,2), point=(0,0,0), up=(0,1,0)), what matrix
will be multiplied into the matrix stack?
c. Suppose we call gluLookAt(eye=(0,0,2), point=(0,0,0), up=(0,1,0)) twice in a row, is
this legal? If so, is there an equivalent glTranslate() command?
Download