CS 476 Computer Graphics, Homework #2

Due: Fri Sep 26 in class. Electronic (e-mail) and paper turnin.
  1. Read Hill Chapter 3
  2. Read GB Chapter 4 (pages 71-103).
  3. Implement a FillCurve(n,x1,y1,x2,y2,...,xn,yn) function. Your function should use variable # of arguments, replicate (x1,y1) after (xn,yn) if they are not identical (in order to close the curve), and then execute a fill algorithm such as those described in class (boundaryfill_4, etc). The fastest correct solution will receive the highest grade. Important: you do not have to behave well with "figure-8's" and other odd shapes that may result from vertices crossing. However, you should test on other odd shapes that do not cross, such as jigsaw puzzle pieces. Write a short report in which you time your FillCurve function against FillPolyon on a simple six-sided shape such as the following. Include in your report a description of how does the FillCurve function visually differ from FillPolygon? Here is a sample image.

    This draws a six-sided shape outlined in blue and fills it in red. The vertices are:
    (50,200),(100,50),(300,50),(350,200),(300,350),(100,350)