.nh .po 5 .ce TEST 1 - CS528 .nf Instructor Dr P Juell NAME_______________________ OPEN BOOK March 26, 1992 100 points This sheet is to be turned in with the test .fi 1. (20) Explain why Bresenham's line algorithm is important in the current state of computer graphics. This question asks to talk about the field of computer graphics, not just drawing lines. 2. (20) Two ways to store information are in raster and polyline forms. Present two good reasons that information such as a outline of the US would be better stored in a polygon rather than a raster form. Present two good reasons for using raster over a polygon. 3. (20) Write a routine (not a full program) called SawTooth(x1,y1,x2,y2,Number_of_teeth) using any routines you want from the book. The points (x1,y1) represent the start of a line and (x2,y2) the end. The parameter Number_of_teeth will specify how many teeth, or points will be drawn. The points are to be 10% of the line's length from the line. For example SawTooth(0,0,1,0,3) would cause a line like: .nf .in +5 /\\ /\\ / \\ / \\ \\/ .fi .in -5 4. (20) Wide screen movies are recorded as about 4 times wider than they are high. This is often displayed in 'letter box' format. That is enough space added above and below the image left blank to allow the full image to go from edge to edge. Assume your display is 8 inches high and 10 inches wide. Specify NDC for the screen boundaries, the viewport and the window for displaying in letter box format. screen viewport window 5. (20) For a hypothetical fighter jet, the pilot has a joystick (J) and two switches (A and B). Moving the joystick forward and back causes the plane's nose to go down and up. Moving the stick left and right cause the plane to turn in the same direction. One press of switch A (in three seconds) selects altitude, 2 presses selects fuel and three speed. Pressing switch B for N seconds causes the status of the item selected by switch A to be spoken by by the onboard computer every N seconds. Classify each of J, A and B as: locator, stroke, string, valuator, choice or pick. Also give a short reason for the choice. J A B