Normand Briere
2018-05-22 42107f9a01652cb2f47228d20c1148a2a22f6a63
new torus code and VR
4 files modified
1 files renamed
45 ■■■■ changed files
BoundaryRep.java 7 ●●●●● patch | view | raw | blame | history
Camera.java patch | view | raw | blame | history
CameraPane.java 12 ●●●● patch | view | raw | blame | history
GroupLeaf.java 3 ●●●● patch | view | raw | blame | history
Torus.java 23 ●●●●● patch | view | raw | blame | history
BoundaryRep.java
....@@ -4932,7 +4932,7 @@
49324932 //colors[i3 + 1] = cp.vertexOcclusion.g;
49334933 //colors[i3 + 2] = cp.vertexOcclusion.b;
49344934
4935
- if ((i % 1000) == 0 && i != 0)
4935
+ if ((i % 100) == 0 && i != 0)
49364936 {
49374937 CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
49384938 //System.out.println("Color = " + cp.vertexOcclusion.r + ", " + cp.vertexOcclusion.g + ", " + cp.vertexOcclusion.b + "; " + (int)(100.0*i/(positions.length/3)) + "% done");
....@@ -4964,7 +4964,7 @@
49644964
49654965 v.AO = cp.vertexOcclusion.r;
49664966
4967
- if ((i % 1000) == 0 && i != 0)
4967
+ if ((i % 100) == 0 && i != 0)
49684968 {
49694969 CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
49704970 //System.out.println("Color = " + cp.vertexOcclusion.r + ", " + cp.vertexOcclusion.g + ", " + cp.vertexOcclusion.b + "; " + (int)(100.0*i/(positions.length/3)) + "% done");
....@@ -7230,7 +7230,8 @@
72307230 {
72317231 if (f3.p == f0.p)
72327232 {
7233
- assert(false);
7233
+// assert(false);
7234
+ new Exception().printStackTrace();
72347235 f0.r = f3.q;
72357236 }
72367237 else
RTCamera.java
similarity index 100%rename from RTCamera.javarename to Camera.java
CameraPane.java
....@@ -12854,7 +12854,9 @@
1285412854 {
1285512855 mouseMode |= ZOOM;
1285612856 }
12857
- if ((modifiers & META) == META)
12857
+
12858
+ boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
12859
+ if (capsLocked || (modifiers & META) == META)
1285812860 {
1285912861 mouseMode |= VR; // BACKFORTH;
1286012862 }
....@@ -12868,6 +12870,7 @@
1286812870 }
1286912871 if ((modifiers & SHIFT) == SHIFT || forcetranslate)
1287012872 {
12873
+ mouseMode &= ~VR;
1287112874 mouseMode |= TRANSLATE;
1287212875 }
1287312876 // if ((modifiers & SHIFT_META) == SHIFT_META)
....@@ -14719,6 +14722,11 @@
1471914722 // System.err.println("view = " + view[8] + " " + view[9] + " " + view[10] + " " + view[11]);
1472014723 // System.err.println("view = " + view[12] + " " + view[13] + " " + view[14] + " " + view[15]);
1472114724
14725
+ // Will fit the mesh !!!
14726
+ selectedpoint.toParent[0][0] = 0.0001;
14727
+ selectedpoint.toParent[1][1] = 0.0001;
14728
+ selectedpoint.toParent[2][2] = 0.0001;
14729
+
1472214730 glu.gluUnProject(x,y,depth,view,0,tempmat2,0,viewport,0,selectedpoint.toParent[3],0);
1472314731
1472414732 // if (object.selection != null && object.selection.Size() > 0)
....@@ -15341,7 +15349,7 @@
1534115349 int AAbuffersize = 0;
1534215350
1534315351 //double[] selectedpoint = new double[3];
15344
- static Sphere selectedpoint = new Sphere();
15352
+ static Superellipsoid selectedpoint = new Superellipsoid();
1534515353 static Sphere previousselectedpoint = null;
1534615354 static Sphere debugpoint = new Sphere();
1534715355 static Sphere debugpoint2 = new Sphere();
GroupLeaf.java
....@@ -9,7 +9,8 @@
99 */
1010 public class GroupLeaf extends Composite
1111 {
12
- static final long serialVersionUID = -1647706059469889079L;
12
+ static final long serialVersionUID = // for wader: -6036608125951558970L;
13
+ -1647706059469889079L;
1314
1415 GroupLeaf()
1516 {
Torus.java
....@@ -61,16 +61,25 @@
6161 if (v == 1)
6262 v = 0;
6363
64
- double uAng = LA.toRadians((1-u) * 360);
65
- double vAng = LA.toRadians(v * 360);
66
- double x = (double)Math.cos(uAng) * (major + (double)Math.cos(vAng) * minor);
67
- double y = (double)Math.sin(vAng) * minor;
64
+ double uAng = u * 2 * Math.PI;
65
+ double vAng = v * 2 * Math.PI;
66
+ double cosua = Math.cos(uAng);
67
+ double sinua = Math.sin(uAng);
68
+ double cosva = Math.cos(vAng);
69
+ double sinva = Math.sin(vAng);
70
+
71
+ double radius = (major + cosva * minor);
72
+ double x = cosua * radius;
73
+ double y = sinva * minor;
6874 if (Math.abs(y) < 1E-10)
6975 y = 0; // hashtable issue
70
- double z = (double)Math.sin(uAng) * (major + (double)Math.cos(vAng) * minor);
76
+
77
+ double z = sinua * radius;
7178 cVector tPos = LA.newVector(x, y, z);
72
- double xx = (double)(Math.cos(uAng) * Math.cos(vAng)) * minor;
73
- double zz = (double)(Math.sin(uAng) * Math.cos(vAng)) * minor;
79
+
80
+ double xx = cosua * cosva * minor;
81
+ double zz = sinua * cosva * minor;
82
+
7483 cVector tNorm = LA.newVector(xx, y, zz);
7584 Vertex temp = new Vertex(tPos);
7685 //temp.pos = tPos; // useless new