A problem in scan converting acgeneral n-sided convex polygon is that a given scan line will not necessarily cross all sides of a polygon.

For a triangle there was only one side not intersected so a simple test was sufficient. If there are many sides it becomes inefficient to test against all sides. So we keep a list of "active" edges, i.e., edges that are crossed by the current scan line. This list is kept by having a list of edges, sorted by Ytop value, and using two pointers, one to the first active edge and the second to the llast active edge.
Here is an example of the changing active edge list as a 5-sided polygon is scan converted.
Sorted list of edges (by Ytop)
List 1

List 2

List 3

So a modified Top Level Algorithm:
![]()
Solid Polygon menu
HyperGraph
Table of Contents.
HyperGraph Home
page.