fscan
22-10-2004, 21:25
hab den scanfill implementiert und bin auf ein problem gestoßen... wenn auf xmax geclippt wird, kann es passieren, dass 2 punkte am fast selben ort sind (double unterscheiden sich schon ... ). das gibt bei mir beim scanline probleme wenn ein poligon mit einer kannte genau am rechten rand ist (bzw gerade drüber). dann hab ich eine ungerade anzahl von activen edges ... hier ein beispiel (debugausgabe)
next is null, scanline: 229 color:java.awt.Color[r=255,g=0,b=0]
active edge list:
234, 435.9761904761913, 1.4047619047619047
234, 506.0, -12.6
229, 506.0000000000001, 1.605263157894737
unclipped
Point 0: X=442.96074788892156 Y=233.77264155099604 Z=-10.460571169502284
Point 1: X=506.7960436054451 Y=229.39042132176584 Z=-11.37788604875686
Point 2: X=444.51532746453523 Y=190.70721549550564 Z=-12.838913695646093
Point 3: X=383.7110097937433 Y=191.57587803532877 Z=-11.921598816391517
clipped to: 1x1 - 506x522
Point 0: X=443 Y=234 Z=-10.460571169502284
Point 1: X=506 Y=229 Z=-11.366446881198947
Point 2: X=506 Y=229 Z=-11.396560235371114
Point 3: X=445 Y=191 Z=-12.838913695646093
Point 4: X=384 Y=192 Z=-11.921598816391517
next is null, scanline: 229 color:java.awt.Color[r=255,g=0,b=0]
active edge list:
234, 435.9761904761913, 1.4047619047619047
234, 506.0, -12.6
229, 506.0000000000001, 1.605263157894737
unclipped
Point 0: X=442.96074788892156 Y=233.77264155099604 Z=-10.460571169502284
Point 1: X=506.7960436054451 Y=229.39042132176584 Z=-11.37788604875686
Point 2: X=444.51532746453523 Y=190.70721549550564 Z=-12.838913695646093
Point 3: X=383.7110097937433 Y=191.57587803532877 Z=-11.921598816391517
clipped to: 1x1 - 506x522
Point 0: X=443 Y=234 Z=-10.460571169502284
Point 1: X=506 Y=229 Z=-11.366446881198947
Point 2: X=506 Y=229 Z=-11.396560235371114
Point 3: X=445 Y=191 Z=-12.838913695646093
Point 4: X=384 Y=192 Z=-11.921598816391517