// // Execution trace of a scan line polygon filling routine for the // general case. Polygon taken from Computer Graphics, by Berger. // // Mark Maloof // July 1998 // Vertex table: v0: (9.0, 1.0) v1: (2.0, 1.0) v2: (3.0, 3.0) v3: (4.0, 7.0) v4: (6.0, 5.0) v5: (8.0, 8.0) v6: (11.0, 4.0) Edge table e0: 0 1 e1: 1 2 e2: 2 3 e3: 3 4 e4: 4 5 e5: 5 6 e6: 6 0 yTop: 1 yBottom: 8 Edge Table: 1: 2.0 2 0.5-->9.0 3 0.66-->null 2: null 3: 3.0 7 0.25-->null 4: 11.0 8 -0.75-->null 5: 6.0 7 -1.0-->6.0 8 0.66-->null 6: null 7: null 8: null y = 1: Active list: 2.0 2 0.5-->9.0 3 0.66-->null filling... setpixel(2,1) setpixel(3,1) setpixel(4,1) setpixel(5,1) setpixel(6,1) setpixel(7,1) setpixel(8,1) updating... resorting... New active list: 2.5 2 0.5-->9.66 3 0.66-->null y = 2: Active list: 2.5 2 0.5-->9.66 3 0.66-->null filling... setpixel(3,2) setpixel(4,2) setpixel(5,2) setpixel(6,2) setpixel(7,2) setpixel(8,2) setpixel(9,2) updating... resorting... New active list: 10.32 3 0.66-->null y = 3: Active list: 3.0 7 0.25-->10.32 3 0.66-->null filling... setpixel(3,3) --> setpixel(9,3) updating... resorting... New active list: 3.25 7 0.25-->null y = 4: Active list: 3.25 7 0.25-->11.0 8 -0.75-->null filling... setpixel(3,4) --> setpixel(10,4) updating... resorting... New active list: 3.5 7 0.25-->10.25 8 -0.75-->null y = 5: Active list: 3.5 7 0.25-->6.0 8 0.66-->6.0 7 -1.0-->10.25 8 -0.75-->null filling... setpixel(4,5) --> setpixel(9,5) updating... resorting... New active list: 3.75 7 0.25-->5.0 7 -1.0-->6.67 8 0.66-->9.5 8 -0.75-->null y = 6: Active list: 3.75 7 0.25-->5.0 7 -1.0-->6.67 8 0.66-->9.5 8 -0.75-->null filling... setpixel(4,6) setpixel(7,6) --> setpixel(9,6) updating... resorting... New active list: 4.0 7 0.25-->4.0 7 -1.0-->7.34 8 0.66-->8.75 8 -0.75-->null y = 7: Active list: 4.0 7 0.25-->4.0 7 -1.0-->7.34 8 0.66-->8.75 8 -0.75-->null filling... setpixel(7,7) setpixel(8,7) updating... resorting... New active list: 8.0 8 0.6666666666666666-->8.0 8 -0.75-->null y = 8: Active list: 8.0 8 0.6666666666666666-->8.0 8 -0.75-->null filling... updating... resorting... New active list: null