Your grade: Doing Part 1 tolerably will get you a 'C'. Doing the more difficult parts and doing them well can earn you up to an 'A'.
(repeating) This assignment is due electronically by the start of class on Thursday, June 28th. Remember, turn in whatever you have done by that time.
You should do your assignment building on the sample code I've written for you.
Assignment 1, Part 1: Delete the calls to drawFatPixel() and replace them with a call to your own drawDDA_Line() which will draw a line between two points (four int arguments), assuming the slope is between 0 and 1. This should use the DDA line drawing algorithm described in Section 3-2. (Also change the String to your own).
Assignment 1, Part 2 (Harder): Replace the DDA algorithm in Part 1 with the Bresenham algorithm.
Assignment 1, Part 3 (Still harder): Make the DDA algorithm work in the various quadrants. Use a larger grid, e.g., 32x32 with smaller pixels. Have the origin of coordinates in the center of the grid. Draw at least five lines, in different colors, to demonstrate the algorithm.
Assignment 1, Part 3 (Still harder): Replace the DDA algorithm in Part 3 with the Bresenham algorithm.
See the page on electronic handins for the correct way to set up your directories and files for your electronic handins.
Return to Prof. Futrelle's home page