Student: mmaa Assignment: 2 Grader: Damian ************************************************ Bresenham: program runs, buggy (55): 55 correct implementation of Bresenham (20): 20 no floats and divides (20): 10 extra credit (5): ---------------------------------------------- total (100): 85 Cohen-Sutherland: program runs, buggy (55): 45 inside case correct (10): 10 outside case correct (10): 10 one clip correct (10): 10 two clips correct (10): 10 extra credit (5): ---------------------------------------------- total (100): 85 Comments: ---------------------------------------------- Bresenham algorithm: A big part of this part of the problem set (as was several times in lecture, via e-mail etc) was to avoid using any floats. In this case, you've used two. "No floats" really did mean "no floats". Oh well. At least you didn't use divide anywhere. CohenSutherland Algorithm: You got the algorithm correct but damn! What a painful way of computing outcodes! You should realize that when you just add 1000 to an integer as you did in your outcode function, that you're adding the decimal 1000, not the binary one (which is why you had to go to such extraordinary lengths to extract the information later). To add and subtract specific bits, simply add and subtract the integer whose binary representation is that single bit. For example, 1001 (binary) = 8+1 = 9 (decimal) because 8 binary is "1000", 1 binary is "0001" and 9 binary is "1001" *************************************************