Answers for Practice Test 16: lower left diagonal of one x 17: answer Edge ymax x dx c dc z dz A 6 5 -2 .4 .6 8 1 B 7 5 1 .4 .3 8 -.5 C 7 e3 4 1 0 9 -2 AEL-5: A(6,4,-1,1,.6,9,1) - B(7,6,1,.7,.3,7.5,1) 18.1: hermite is superior to bezier if interpolation is wanted. b-spline is preferable to bezier if c2 continuity is wanted. The two bezier segments are C1 continuous if their tangents have the same direction and magnitude. 18.2: t(1/2) = (1.5,0) 18.3: the two segments are C1 continuous if their tangents have the same direction and magnitude. if this is not the case, one of the control points before or after the common control point can be moved to make this true. 18.4: Gx = 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 Gy = 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 Gz = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 18.5: interpolating: hermite, catmull-rom C2: b-spline convex hull: bezier, b-spline 19.1: fractals, bump mapping, displacement mapping 19.2: points are not on the surface, but are on the same side of the surface. 19.3: (won't be on exam) 20: Assuming segments are initially lined up in a straight line from left to right starting at the origin. Matrices for converting a point from the 3rd segment's local coordinate system to world coordinates are: m1 x m2 x m3 x m4 x m5 x m6 x p where p = point in 3rd segment's local coordinate system, m1, m2, m6 are identity matrices and m3 = 1 0 3 0 1 0 0 0 1 m4 = 0 1 0 -1 0 0 0 0 1 m5 = 1 0 2 0 1 0 0 0 1 21.1: warnock area subdivision: if current area contains nothing or one thing, draw else divide current area into four subdivisions and recurse. weiler-atherton: like warnock, but instead of dividing into fourths, divide current area using polygon closest to eye like a cookie cutter to subdivide the area in two: 1)inside polygon and 2)outside of it. ray-casting: process pixels one at a time by casting a ray from the camera location through the pixel and calculating the depth for 1st surface encountered along the ray path. z-buffer: draw a pixel corresponding to a particular position on a polygon only if that position is closer to the eye than the value stored in the z-buffer for that pixel. if this is the case, update the z-buffer so that it contains the polygon's z value. octree: figure out which corner of the octree is closest to the camera to determine the back to front order of the octants. floating horizon: draw one line per z value for a function in order from front to back. At each x position, see if the y value for the function is >= the largest y value drawn at that x position so far (horizon[x]). if so, draw the portion of the line, and replace the current value of horizon[x] with y. watkin's scaline: 1) sort polygon edges from left to right and by z value. 2) for each scanline, fill in polygons between their left and right edges using the polygon's color. 3) if another polygon's edge appears before the current polygon's right edge has been reached and the new edge is closer to the eye than the current polygon's z value, then make the new polygon the current polygon and go to step 2). painter's algorithm: sort polygons from back to front, then draw them in back to front order. ray-tracing: determine the scene's contribution to each pixel by tracing the light path backwards from the pixel to the scne. Trace reflected and refracted paths. Stop when a path reaches a preset maximum number of reflection/refraction paths or when the ray strikes a light source. 21.2: Painter's algorithm works best when 1) the scene has few polygons and complex tests to determine which polygon is in front aren't required and 2) there isn't much obscuring of polygons by other polygons. z-buffer takes constant time and is therefore good for complex scenes with lots of polygons in them. ray tracing is the slowest of the four methods because of the complexity of calculating reflection/refraction ligt paths. area subdivision: the subdivision tests are relatively complex in this method, so its performance is usually not very good. 21.3: Assuming that the z values for points in the sample test are actually negative instead of positive: Frame Buffer: (B = black, R = red, C = cyan) 4 B B B B B B 3 B R C C B B 2 B R C C B B 1 B R R R B B 0 B B B B B B 0 1 2 3 4 5 z-buffer: 4 i i i i i i 3 i 4 1 1 i i 2 i 2 1 1 i i 1 i 0 0 0 i i 0 i i i i i i 0 1 2 3 4 5 23: y - z = 0 z up = z + 1 z right = z