Due midnight 29 September 2008
In this assignment you'll implement the scanline fill algorithms for polygons. The algorithm is probably going to become the most used piece of code you'll write this semester and will be central to your rendering system. As such, take care to comment the code and understand what is going on.
Implement the scanline fill algorithm for polygons. You can
write it from scratch, use the version in one of the textbooks, or
use this scanfill skeleton code as
the basis for your function. Make sure that your algorithm uses the
correct placement of the coordinate grid (lower left corner of the
pixel). The name for this routine should be
Polygon_drawFill(). Your algorithm should not create a
border that is a different color than the fill color. Just draw the
filled in polygon as a single color.
The updated C and C++ Graphics System Specifications contain the details of the function prototypes. For this lab, do not implement the shadeFill function, and do not worry about z-values. The drawFill function should just color the polygon a single color.
If you want to do a gradient fill, texture fill, or pattern fill, create separate functions for them.
- Implement the polyline object primitive and its attendant functions (again, don't worry about z-buffers yet). When drawing a polyline, do not connect the last point to the first point. The user must make the last point and first point the same to close the polyline structure if they so choose.
- One required image is the same as the previous assignment, a picture of a car, train, plane, or spaceship, except that a majority of the surfaces should be colored/filled in.
- Use the linked C file or C++ file to create the second required image.
- Create two images for your portfolio using the techniques you have developed so far and any extensions you decided to pursue.
- An animated gif or series of images that demonstrates the scanline fill algorithm (e.g. a short tutorial).
- Allow the use of a fill pattern (e.g. an 8x8 bitmap) in addition to the fill color.
- Allow the user to draw filled graphics primitives with a variety of overlay options so you can easily simulate transparency and other effects.
- Anti-alias your polygons.
- Create flood-fill routines.
- Allow the user to specify a gradient across a polygon, circle, or ellipse so that they appear shaded.
- Cool artistic pictures demonstrating some interesting feature of your system.
All writeups should suggest the format of a lab report. They do not have to be long, but need to provide enough information that I have some idea you knew what you were doing.
- Abstract: 200 word description (at most) of what you did and a picture to go along with it.
- Description of the task, in your own words. Be brief, but write it as though explaining it to a fellow student not in the course.
- Description of how you solved the task, including any key equations or algorithms. You should also include algorithms or descriptions of what you did for any extensions. Include pictures here.
- More pictures. Please put a caption on each picture explaining something about it. If you have nothing else, give it a name and indicate whose picture it is.
- Summary of what you learned.
Put your code files in your handin folder. Send the prof an email with the URL for your writeup (wiki or standard web page) when it's done. In either case, please edit the assignment handin page on the wiki so there is a link to your assignment.