![]() | Task one was to implement the scanline fill algorithm for polygons. We used the code from the Hearn & Baker website, and modified it to fit our graphics environment and to compensate for corner-based coordinates as opposed to center-based coordinates. |
![]() | Task two was to implement a scanline fill for circles and ellipses. We accomplished this by filling four lines for every circle point created. |
![]() | Task three was to implement Polyline(). Polyline just plays connect the dots with the points it's given. |
![]() | Task four was to create a cube on a table with filled polygons. For two of our extensions, we added gradient fills and bitmap fills, so I did the gaudy wallpaper with bitmap fills, and the box and table legs with gradient fills. |
![]() | Task 5 was to create a required image with corners at coordinates
(30, 30)
(80, 40)
(50, 60)
(80, 80)
(50, 80)
(40, 70)
(30, 80)
|

![]() | For the gradient fill, we added two arguments to the polyFill function to make gPolyFill. The two arguments were the starting color and the ending color. The program then determines the width of the polygon and shades it with a straight-line fit from left to right so that the leftmost pixel is the first color, and the right most pixel is the second color. |
![]() | For the bitmap fill, we added an 8x8 bitmap to the arguments of polyFill to make bPolyFill. The fill pattern is based on the absolute location (x%8 and y%8). |