From 64e20f390e4b8e58bd0006dde8fa10fba1dac1d5 Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Fri, 16 Aug 2019 13:25:19 -0400 Subject: [PATCH] Fix box and VR keys. --- BoundaryRep.java | 31 +++++++++++++++++++++---------- 1 files changed, 21 insertions(+), 10 deletions(-) diff --git a/BoundaryRep.java b/BoundaryRep.java index 883e363..5e5371f 100644 --- a/BoundaryRep.java +++ b/BoundaryRep.java @@ -1997,7 +1997,10 @@ if (v.vertexlinks == null) continue; - if (v.weights != null && v.weights[j] < 0.001 * v.totalweight) // == 0) + // Warning: faster but dangerous + if (v.weights != null && v.weights[j] + // == 0) + < 0.0001 * v.totalweight) { //testweight += v.weights[j-1]; continue; @@ -4001,7 +4004,7 @@ NormalGenerator ng; if (crease) - ng = new NormalGenerator(Math.PI/6); // default is 44 degrees (or Math.PI/3); // /4); + ng = new NormalGenerator(Math.PI/4); // default is 44 degrees (or Math.PI/3); // /4); else ng = new NormalGenerator(Math.PI); // (Math.PI / 3); // /4); @@ -4019,8 +4022,6 @@ //System.out.println("NEW = " + positions.length); uvmap = new float[ta.getVertexCount() * 2]; - colors = new float[ta.getVertexCount()]; // * 3]; - ta.getCoordinates(0, positions); ta.getNormals(0, normals); // ta.getColors(0, colors); @@ -4028,6 +4029,14 @@ System.out.println("UV = " + uvmap[2] + ", " + uvmap[3] + ";"); + colors = null; +// colors = new float[ta.getVertexCount()]; // * 3]; +// +// for (int i=colors.length; --i>=0;) +// { +// colors[i] = 1; +// } + triangles = new int[ta.getVertexCount()]; for (int i = 0; i < triangles.length; i++) @@ -4065,17 +4074,18 @@ positions = new float[3 * ga.getVertexCount()]; normals = new float[3 * ga.getVertexCount()]; uvmap = new float[2 * ga.getVertexCount()]; - colors = new float[1 * ga.getVertexCount()]; tsa.getCoordinates(0, positions); tsa.getNormals(0, normals); tsa.getTextureCoordinates(0, 0, uvmap); // tsa.getColors(0, colors); - - for (int i=colors.length; --i>=0;) - { - colors[i] = 1; - } + + colors = null; +// colors = new float[1 * ga.getVertexCount()]; +// for (int i=colors.length; --i>=0;) +// { +// colors[i] = 1; +// } int stripcount = tsa.getNumStrips(); triangles = new int[stripcount]; @@ -4084,6 +4094,7 @@ stripified = true; } catch (ClassCastException e) { + // ??? aug 2019 TriangleArray ta = (TriangleArray) ga; positions = new float[3 * ga.getVertexCount()]; -- Gitblit v1.6.2