Normand Briere
2019-09-02 21ac57b36a9e3b909853c7d64ac29b7ad72490a3
BoundaryRep.java
....@@ -686,6 +686,7 @@
686686
687687 void RecomputeBasis(BoundaryRep other, double[][] toRoot, Vertex v)
688688 {
689
+ CameraPane.CreateSelectedPoint();
689690 CameraPane.selectedpoint.
690691 getAverage(cStatic.point1, true);
691692
....@@ -1003,6 +1004,7 @@
10031004
10041005 v.closestsupport = -1;
10051006
1007
+ CameraPane.CreateSelectedPoint();
10061008 CameraPane.selectedpoint.
10071009 getAverage(cStatic.point1, true);
10081010
....@@ -1261,6 +1263,7 @@
12611263 for (int wi = v0.weights.length; --wi>=0;)
12621264 v[wi] = 0;
12631265
1266
+ CameraPane.CreateSelectedPoint();
12641267 CameraPane.selectedpoint.
12651268 getAverage(cStatic.point1, true);
12661269
....@@ -1398,6 +1401,7 @@
13981401 v0.x = v0.y = v0.z = 0;
13991402 v0.norm.x = v0.norm.y = v0.norm.z = 0;
14001403
1404
+ CameraPane.CreateSelectedPoint();
14011405 CameraPane.selectedpoint.
14021406 getAverage(cStatic.point1, true);
14031407
....@@ -1997,7 +2001,10 @@
19972001 if (v.vertexlinks == null)
19982002 continue;
19992003
2000
- if (v.weights != null && v.weights[j] < 0.001 * v.totalweight) // == 0)
2004
+ // Warning: faster but dangerous
2005
+ if (v.weights != null && v.weights[j]
2006
+ // == 0)
2007
+ < 0.0001 * v.totalweight)
20012008 {
20022009 //testweight += v.weights[j-1];
20032010 continue;
....@@ -4001,7 +4008,7 @@
40014008 NormalGenerator ng;
40024009
40034010 if (crease)
4004
- ng = new NormalGenerator(Math.PI/6); // default is 44 degrees (or Math.PI/3); // /4);
4011
+ ng = new NormalGenerator(Math.PI/4); // default is 44 degrees (or Math.PI/3); // /4);
40054012 else
40064013 ng = new NormalGenerator(Math.PI); // (Math.PI / 3); // /4);
40074014
....@@ -4019,8 +4026,6 @@
40194026 //System.out.println("NEW = " + positions.length);
40204027 uvmap = new float[ta.getVertexCount() * 2];
40214028
4022
- colors = new float[ta.getVertexCount()]; // * 3];
4023
-
40244029 ta.getCoordinates(0, positions);
40254030 ta.getNormals(0, normals);
40264031 // ta.getColors(0, colors);
....@@ -4028,6 +4033,14 @@
40284033
40294034 System.out.println("UV = " + uvmap[2] + ", " + uvmap[3] + ";");
40304035
4036
+ colors = null;
4037
+// colors = new float[ta.getVertexCount()]; // * 3];
4038
+//
4039
+// for (int i=colors.length; --i>=0;)
4040
+// {
4041
+// colors[i] = 1;
4042
+// }
4043
+
40314044 triangles = new int[ta.getVertexCount()];
40324045
40334046 for (int i = 0; i < triangles.length; i++)
....@@ -4065,17 +4078,18 @@
40654078 positions = new float[3 * ga.getVertexCount()];
40664079 normals = new float[3 * ga.getVertexCount()];
40674080 uvmap = new float[2 * ga.getVertexCount()];
4068
- colors = new float[1 * ga.getVertexCount()];
40694081
40704082 tsa.getCoordinates(0, positions);
40714083 tsa.getNormals(0, normals);
40724084 tsa.getTextureCoordinates(0, 0, uvmap);
40734085 // tsa.getColors(0, colors);
4074
-
4075
- for (int i=colors.length; --i>=0;)
4076
- {
4077
- colors[i] = 1;
4078
- }
4086
+
4087
+ colors = null;
4088
+// colors = new float[1 * ga.getVertexCount()];
4089
+// for (int i=colors.length; --i>=0;)
4090
+// {
4091
+// colors[i] = 1;
4092
+// }
40794093
40804094 int stripcount = tsa.getNumStrips();
40814095 triangles = new int[stripcount];
....@@ -4084,6 +4098,7 @@
40844098 stripified = true;
40854099 } catch (ClassCastException e)
40864100 {
4101
+ // ??? aug 2019
40874102 TriangleArray ta = (TriangleArray) ga;
40884103
40894104 positions = new float[3 * ga.getVertexCount()];