Home Products Download Order Contacts

comp.graphics.algorithms

Subject: Even-odd polygon filling fails



I'm having a spot of trouble implementing a line-span even-odd polygon fill
routine.
The algorithm as outlined on
http://www.cs.rit.edu/~icss571/filling/example.html works fine but my
even-odd flag fails on some 'whole' vertices. It must be near this (right
after setting pointers to the top and bottom vertex of each segment):
for (i = 0; i < numedges; i++) {
if (edges[i].top->y <= y && edges[i].bottom->y >= y) {
// Add to the active edge table.
active_edges[active++] = i;
}
}
-- sorting on x follows, then the span drawing itself. I can't always count
on active being a multiple of 2 -- that must be part of the problem. I tried
"edges[i].bottom->y > y" in the edge test but that seems not to work. Any
ideas?

[Jongware]



Reply


View All Messages in comp.graphics.algorithms

path:


Replies:

Copyright 2006 WatermarkFactory.com. All Rights Reserved.