diff --git a/src/org/poly2tri/Poly2Tri.scala b/src/org/poly2tri/Poly2Tri.scala index 00a271c..4a50cb4 100644 --- a/src/org/poly2tri/Poly2Tri.scala +++ b/src/org/poly2tri/Poly2Tri.scala @@ -87,7 +87,7 @@ class Poly2TriDemo extends BasicGame("Poly2Tri") { val i18 = "data/i.18" val tank = "data/tank.dat" - var currentModel = nazcaHeron + var currentModel = nazcaMonkey var doCDT = true var mouseButton = 0 @@ -97,7 +97,7 @@ class Poly2TriDemo extends BasicGame("Poly2Tri") { var mousePosOld = Point(0, 0) var deltaX = 0f var deltaY = 0f - var scaleFactor = 1f + var scaleFactor = 0.85f var gameContainer: GameContainer = null diff --git a/src/org/poly2tri/cdt/CDT.scala b/src/org/poly2tri/cdt/CDT.scala index e26f0d7..f5076b4 100644 --- a/src/org/poly2tri/cdt/CDT.scala +++ b/src/org/poly2tri/cdt/CDT.scala @@ -404,8 +404,11 @@ class CDT(val points: List[Point], val segments: List[Segment], iTriangle: Trian val point = t1.points(0) val oPoint = t2 oppositePoint t1 - - if(illegal(t1.points(1), t1.points(0), t1.points(2), oPoint) && !t2.finalized) { + + // Pints are oriented ccw + val illegal = Util.incircle(t1.points(1), t1.points(2), t1.points(0), oPoint) + + if(illegal && !t2.finalized) { // Flip edge and rotate everything clockwise t1.legalize(oPoint)