From a7277e6c6381e55761f7fa87276260fac1c94d5e Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Wed, 01 May 2019 22:31:45 -0400 Subject: [PATCH] Bigger default size. --- BoundaryRep.java | 18 +++++++++++++++++- 1 files changed, 17 insertions(+), 1 deletions(-) diff --git a/BoundaryRep.java b/BoundaryRep.java index 05b3429..e938a9a 100644 --- a/BoundaryRep.java +++ b/BoundaryRep.java @@ -3247,12 +3247,21 @@ max = ay; } + if (max == 0) + { + uvmap[i2] = 0.5f; + uvmap[i2+1] = 0.5f; + continue; + } + x /= max; y /= max; double angle = Math.acos(Math.abs(z*2)); double k = angle / Math.PI * 2; + + assert(k >= 0); // k == 0 => uv = 0 (center) // k == 1 => uv = -1,1 (border) @@ -3268,7 +3277,8 @@ t = Math.pow(t, 3); // Interpolate between k/length2 (center) and k (border) - k = k / length2 * (1 - t) + k * t; + if (length2 > 0) + k *= (1 - t) / length2 + t; double u = k*x; double v = k*y; @@ -3892,6 +3902,11 @@ tsa.getNormals(0, normals); tsa.getTextureCoordinates(0, 0, uvmap); // tsa.getColors(0, colors); + + for (int i=colors.length; --i>=0;) + { + colors[i] = 1; + } int stripcount = tsa.getNumStrips(); triangles = new int[stripcount]; @@ -6344,6 +6359,7 @@ void InitWeights() { + new Exception().printStackTrace(); System.exit(0); int n = 0; int b = 0; -- Gitblit v1.6.2