Student: rwsu Assignment: 2 Grader: Damian ************************************************ Bresenham: program runs (55): 55 correct implementation of Bresenham (20): 20 no floats and divides (20): 20 extra credit (5): 5 ---------------------------------------------- total (100): 100 Cohen-Sutherland: program runs (55): 55 inside case correct (10): 10 outside case correct (10): 10 one clip correct (10): 10 two clips correct (10): 0 extra credit (5): ---------------------------------------------- total (100): 85 Comments: ---------------------------------------------- Bresenham Algorithm: Okay, you got the algorithm right, tehcnically, but your implementation was not pretty. You don't need to explicitly list every case, you can have a few conditional statements set up some variables, and then have a central loop which runs for all possible cases. Also, multiplying everything by your "tune" variable of 10000 is not a great idea. After all, when dy = 1 and dx = 3, dy/dx will still produce a non-integer. In this case it turned out alright. But a more straightforward way to do it would have been to multiply all the numbers by 2*dx. Check it out, it works. Cohen-Sutherland: You have a serious problem with your Cohen Sutherland implementation. For example, draw a line from the region to the bottom left of the viewport and sweep it over the top of the box. You'll find that in some situations your algorithm fails to draw anything at all, and reports the cliptype to be "external" when in fact it is very obviously internal. Looking at your code, your algorithm seems a good deal more complex than it needs to be. Also, you have some problem with your op-codes: you use them correctly on line 90, for example, but at line 122 and later, you begin to use them incorrectly -- comparing an integer temp_o == 1000 is NOT the same as asking whether the 4th bit is set (whereas comparing temp_o == 8 IS.) *************************************************