

Back
Next
Viewing & Rendering
Polygon-Filling Algorithm
Find intersection of scan line with all edges of polygon by solving simultaneous equations.
Sort the intersection by increasing x-coordinates.
Fill in all pixels between pairs of intersections that lie interior to the polygon, using the odd-parity rule to determine if a point is inside a region. Each vertex encountered flips the parity bit. The rule is: draw when parity is odd, don't draw when parity is even. Parity always starts out even.
Special cases: vertices, horizontal lines, very thin slivers.



Back
Next
Viewing & Rendering - 09 MAY 95
Page 23 of 31
sl@cs.brown.edu
Generated with CERN WebMaker