Normand Briere
2019-06-23 8088590686a45e71278f9a52bb9cc37943dc0c37
CameraPane.java
....@@ -37,7 +37,6 @@
3737 static boolean[] selectedstack = new boolean[65536];
3838 static int materialdepth = 0;
3939
40
- static boolean DEBUG = false;
4140 static boolean FRUSTUM = false; // still bogus true; // frustum culling
4241
4342 // camera change fix
....@@ -464,10 +463,12 @@
464463 if (!selectmode) // display.drawMode != display.SELECTION) // && display.drawMode != display.SHADOW) // (attributes & FILL) != 0)
465464 {
466465 //gl.glBegin(gl.GL_TRIANGLES);
467
- boolean hasnorm = pv.norm != null && (pv.norm.x != 0 || pv.norm.y != 0 || pv.norm.z != 0);
466
+ boolean hasnorm = pv.norm != null && (pv.norm.x != 0 || pv.norm.y != 0 || pv.norm.z != 0)
467
+ // TEST LIVE NORMALS && !obj.dontselect
468
+ ;
468469 if (!hasnorm)
469470 {
470
- // System.out.println("FUCK!!");
471
+ // System.out.println("Mesh normal");
471472 LA.vecSub(pv/*.pos*/, qv/*.pos*/, obj.v0);
472473 LA.vecSub(pv/*.pos*/, rv/*.pos*/, obj.v1);
473474 LA.vecCross(obj.v0, obj.v1, obj.v2);
....@@ -1192,10 +1193,12 @@
11921193 gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
11931194 }
11941195 }
1196
+
11951197 if (flipV)
11961198 gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
11971199 else
11981200 gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
1201
+
11991202 //System.out.println("vertex1 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]);
12001203 gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
12011204
....@@ -1215,10 +1218,12 @@
12151218 gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
12161219 }
12171220 }
1221
+
12181222 if (flipV)
12191223 gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
12201224 else
12211225 gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
1226
+
12221227 //System.out.println("vertex2 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]);
12231228 gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
12241229
....@@ -1246,8 +1251,10 @@
12461251 gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
12471252 else
12481253 gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
1254
+
12491255 //System.out.println("coord3 = " + uv[count2] + ", " + uv[count2+1]);
12501256 gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
1257
+
12511258 count2 += 2;
12521259 count3 += 3;
12531260 }
....@@ -2259,7 +2266,7 @@
22592266
22602267 void ToggleDebug()
22612268 {
2262
- DEBUG ^= true;
2269
+ Globals.DEBUG ^= true;
22632270 }
22642271
22652272 void ToggleLookAt()
....@@ -11451,6 +11458,24 @@
1145111458
1145211459 static boolean zoomonce = false;
1145311460
11461
+ void CreateSelectedPoint()
11462
+ {
11463
+ if (selectedpoint == null)
11464
+ {
11465
+ debugpointG = new Sphere();
11466
+ debugpointP = new Sphere();
11467
+ debugpointC = new Sphere();
11468
+ debugpointR = new Sphere();
11469
+
11470
+ selectedpoint = new Superellipsoid();
11471
+
11472
+ for (int i=0; i<8; i++)
11473
+ {
11474
+ debugpoints[i] = new Sphere();
11475
+ }
11476
+ }
11477
+ }
11478
+
1145411479 void DrawObject(GL gl, boolean draw)
1145511480 {
1145611481 //System.out.println("DRAW OBJECT " + mouseDown);
....@@ -11531,8 +11556,9 @@
1153111556
1153211557 if (DrawMode() == DEFAULT)
1153311558 {
11534
- if (DEBUG)
11559
+ if (Globals.DEBUG)
1153511560 {
11561
+ CreateSelectedPoint();
1153611562 float radius = 0.05f;
1153711563 if (selectedpoint.radius != radius)
1153811564 {
....@@ -14894,8 +14920,14 @@
1489414920 RevertCamera();
1489514921 repaint();
1489614922 break;
14897
- case 'L':
1489814923 case 'l':
14924
+ lightMode ^= true;
14925
+ Globals.lighttouched = true;
14926
+ manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;
14927
+ targetLookAt.set(manipCamera.lookAt);
14928
+ repaint();
14929
+ break;
14930
+ case 'L':
1489914931 if (lightMode)
1490014932 {
1490114933 lightMode = false;
....@@ -15042,16 +15074,14 @@
1504215074 kompactbit = 6;
1504315075 break;
1504415076 case ' ':
15045
- lightMode ^= true;
15046
- Globals.lighttouched = true;
15047
- manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;
15048
- targetLookAt.set(manipCamera.lookAt);
15077
+ ObjEditor.theFrame.ToggleFullScreen();
1504915078 repaint();
1505015079 break;
1505115080 //case '`' :
1505215081 case ESC:
1505315082 RENDERPROGRAM += 1;
1505415083 RENDERPROGRAM %= 3;
15084
+
1505515085 repaint();
1505615086 break;
1505715087 case 'Z':
....@@ -17227,23 +17257,15 @@
1722717257 int AAbuffersize = 0;
1722817258
1722917259 //double[] selectedpoint = new double[3];
17230
- static Superellipsoid selectedpoint = new Superellipsoid();
17260
+ static Superellipsoid selectedpoint;
1723117261 static Sphere previousselectedpoint = null;
17232
- static Sphere debugpointG = new Sphere();
17233
- static Sphere debugpointP = new Sphere();
17234
- static Sphere debugpointC = new Sphere();
17235
- static Sphere debugpointR = new Sphere();
17262
+ static Sphere debugpointG;
17263
+ static Sphere debugpointP;
17264
+ static Sphere debugpointC;
17265
+ static Sphere debugpointR;
1723617266
1723717267 static Sphere debugpoints[] = new Sphere[8];
1723817268
17239
- static
17240
- {
17241
- for (int i=0; i<8; i++)
17242
- {
17243
- debugpoints[i] = new Sphere();
17244
- }
17245
- }
17246
-
1724717269 static void InitPoints(float radius)
1724817270 {
1724917271 for (int i=0; i<8; i++)