grassi3000
16-10-2004, 16:35
There is also a bug in the implementation of the book: In closeClip() (http://www.cg.tuwien.ac.at/courses/CG/LU/doxygen/classCG1Polygon.html#b5), the final segment of the polygon should only be clipped against an edge, if we clipped against that edge at least once before. Add an if-statement to check for this. If we do not do this, the algorithm will fail for any polygon that lies completely outside an edge.
Wie genau kann ich das implementieren?
Muss ich mir da ein globales int[] schongeclipped = {0,0,0,0} (für left,right,bottom,top
erstellen, in dem ich in clipPoint() sobald ich gegen eine kante geclipped habe, die jeweilige 0 auf 1 setze, und in
closeClip() nach der ersten for schleife abfrage, ob schon geklippt wurde, oder nicht?
was mache ich, wenn noch nicht geclippt wurde? nix?
mfg
g3k
Wie genau kann ich das implementieren?
Muss ich mir da ein globales int[] schongeclipped = {0,0,0,0} (für left,right,bottom,top
erstellen, in dem ich in clipPoint() sobald ich gegen eine kante geclipped habe, die jeweilige 0 auf 1 setze, und in
closeClip() nach der ersten for schleife abfrage, ob schon geklippt wurde, oder nicht?
was mache ich, wenn noch nicht geclippt wurde? nix?
mfg
g3k