Problem #1, Transformations (8pts) |
All questions assume a right handed coordinate system. Circle the correct answer: (2 pts each) a) In 3 space, two rotations about arbitrary axes can alaways be applied in either order to get the same result. True / False b) In 3-space, two rotations about principal axes can always be applied in either order to get the same result. True / False c) In 3-space, two uniform scalings (scaling with different scale factors in x, y, and z) can always be applied in either order to get the same result. True / False Short answer: (2 pts each) d) In a right handed coordinate system, in what direction does the positive y-axis point after a 90 degree rotation around the positive x-axis? |
Problem #2, Display Hardware (12 pts) |
|
Suppose we have a frame buffer with
MAKE NO ASSUMPTIONS ABOUT THE RELATIVE MAGNITUDES OF x, y, n, AND w. a) How many colors can we choose from for our color table? b) What is the maximum number of different colors we can have in our color table at one time? c) What is the maximum number of different colors that can be displayed on our screem at one time? |
Problem #3, Vanishing Points (18 pts) |
|
In this problem, we use this perspective projection:
a) What is the vanishing point for the family of lines: p0 + t(1,1,1)? b) Describe the set of lines whose vanishing point is (x,y,2. c) what is the 4x4 matrix that will compute this projection? (You may express this as a product of 4x4 matrices if you prefer.) |
Problem #4, is nonexistant |
Problem #5, Sample Point Algorithms for Scan Conversion (12 pts) |
|
The images on the left of this figure illustrate a sample point scan conversion algorithm that uses a sample point somewhere on the edge of a pixel. The thick lines indicate polygon boundaries. The shaded regions indicate pixels that were determined to be interior based on the algorithm. All of the vertices of polygons in this figure lie exactly on pixel grid lines or exactly halfway between pixel grid lines.
a) What is the sample point for this algorithm? Draw a pixel and indicate the sample point. b) Scan convert the cat. Shade in all of the pixels that should be interior to the cat polygon on the right according to this scan conversion algorithm. (Some pixels have been pre-shaded for your convenience.) |
Problem #6, Interior and Exterior of Polygons (16 pts) |
|
a) In this figure, we see a window divided into two labeled regions by an edge of a polygon. We do not know the orientation of the edge between region A and B.
In each row of this table, one entry has been filled in to indicate that we know whether the given region is interior to the polygon by the given rule. Your task is to fill in the remaining table entries. (Each ros represents a different geometry for the polygon outside the window.) Each entry in the table should be one of these three values:
---------------------------------------------------------------------------- | Region A | Region B | ---------------------------------------------------------------------------- | Winding Rule | Parity Rule | Non exterior | Winding Rule | Parity Rule| | in/out/? | in/out/? | in/out/? | in/out/? | in/out/? | ---------------------------------------------------------------------------- | | | in | | | ---------------------------------------------------------------------------- | | | out | | | ---------------------------------------------------------------------------- | in | | | | | ---------------------------------------------------------------------------- | out | | | | | ---------------------------------------------------------------------------- | | in | | | | ---------------------------------------------------------------------------- | | out | | | | ---------------------------------------------------------------------------- In this figure, we see a window divided into four regions labeled with their winding numbers. Draw in the rest of the contour outside the window in a way consistent with the given winding numbers.
|
|
Here, the numbering on the test stops. For simplicity, I will just give questions without numbers the numbers they presumably should have. Problem #7, Scan Converting Lines, Circles, and Ellipses and misc Hardware |
Scan Converting Lines, Circles, and Ellipses and misc Hardware
|
Problem #8, Scan Conversion (25 points) |
|
In the figure below, the gray areas represent a dense concentration of edges of a single, very degenerate polygon. You cannot tell how many edges there are within that region, nor the direction of them. There are six edges we are sure of -- these are labeled in bold with the directions specified. There are three topologically distinct regions we care about, A, B, and C. Each label in question 7.2 and 7.3 is worth 2 points for a correct answer, -1 point for a wrong answer (we'll mark "2/-1 points"), and 0 points if left blank. This is so that a random guessing strategy will, on average, yield 0 overall points.
(7.2) (2/-1 points) Using the PARITY rule, mark regions A, B, and C on the diagram with one of these three labels: PI, PO, P? (for "Parity IN", "Parity OUT", or "Parity Depends-what-is-in-the-gray-region") (7.3) (2/-1 points) Using the WINDING rule, mark regions A, B, and C on the diagram with one of three labels: WI, WO, W? (for "Winding IN", Winding OUT", or "Winding Depends-what-is-in-the-gray-region") (7.4) (5 points) There are 6 bold edges with directions specified. If we remove the directional label on two of them (but don't tell you which two), draw a circle around the label of the region(s) whose WINDING rule label from (7.3) could change. |
Problem #9, Transformations (25 points) |
|
(9.1) (5pts) Each of the following 4 x 4 matrices can be best described as performing one of the following transformations: translation, rotation, scaling, shearing, reflection, or perspective projection. The matrices are designed to operate on column vectors. For each matrix, write next to it which sort of transformation it is.
| 2 0 0 0 | | 0 3/2 0 0 | | 0 0 3 0 | | 0 0 0 1 | | 1 0 0 0 | | 0 1 0 0 | | 0 0 1 0 | | 0 0 -1 1 | | 1 0 1 0 | | 0 1 2 0 | | 0 0 1 0 | | 0 0 0 1 | rt(x) means square root of x | rt(2)/2 0 rt(2)/2 0 | | 0 1 0 0 | | -rt(2)/2 0 rt(2)/2 0 | | 0 0 0 1 | | 1 0 0 rt(3) | | 0 1 1 1/2 | | 0 0 1 rt(2) | | 0 0 0 1 | (9.2) (5 pts) Some of the transformations on #D points that are useful in graphics can be represented as simple 3 x 3 matrix transformations in R3, that is, y=Ax where x and y are in R3, and A is in R3x3. Some other useful transformations are not linear operations in R3, and thus cannot be represented by a 3x3 matrix. However, by using homogeneous coordinates, everal of these non-linear transformations can be represented by 4x4 matrices. For each type of transformation below, write whether it is linear, and can be represented as a 3x3 matrix, or homogeneous if it requires a 4 x 4 matrix and homogeneous coordinates.
(9.3) (7 pts) Derive transformation that rotates points about the axis going from (1,0,0) to (2,1,0) by angle ALPHA. You may write your answer either as a 4x4 column vector homogeneous transformation matrix, or in terms of the transformations T(x,y,z), Rx(THETA), Ry(THETA), and Rz(THETA) as discussed in the book. (9.4) (8 pts) You are writing a simple GL program to experiment with its viewing transformation commands, translate(x,y,z) and rotate(angle,axis). The program you begin with includes a C function, drawcube(), that draws a tiny cube, with sides of length 0.2, centered about the origin. The program also draws the coordinate axes and three circles in the x-z plane, with radii 2, 3, and 4. The drawcube() function produces the following small cube:
drawcube(); The program also includes a funtion called drawcubecircle() that draws twelve cubes in a circle using the GL translate() and rotate() commands as shown below. Note that the rotate(int angle, char axis) command expectsits angle in tenths of degrees, so rotate(300,'y') rotates thirty degrees about the y axis.
void drawcubecircle() {
int i;
for (1=o;i<12;i++) {
translate(3,0,0);
drawcube();
translate(-3,0,0);
rotate(300,'y');
}
}
Write a new function, called drawcubetorus(), that uses the same sorts of techniques as in drawcubecircle(), to produce the following figure. The inenr radius of the torus is 2, the outer radius is 4, and the torus consists of twelve rings of radius 1 with eighteen cubes each.
void drawcubetorus() {
/* write your code here */
}
|
Problem #10, Projection and Perspective |
Projection and perspective
|