Normand Briere
2019-06-25 ecff440ceef3ad352aa64cedbb913107ec4863a5
CameraPane.java
....@@ -326,7 +326,7 @@
326326 cStatic.objectstack[materialdepth++] = obj;
327327 //System.out.println("material " + material);
328328 //Applet3D.tracein(this, selected);
329
- display.vector2buffer = obj.projectedVertices;
329
+ //display.vector2buffer = obj.projectedVertices;
330330 if (obj instanceof Camera)
331331 {
332332 display.options1[0] = material.shift;
....@@ -358,7 +358,7 @@
358358 /**/
359359 } else
360360 {
361
- DrawMaterial(material, selected);
361
+ DrawMaterial(material, selected, obj.projectedVertices);
362362 }
363363 } else
364364 {
....@@ -382,8 +382,8 @@
382382 cStatic.objectstack[materialdepth++] = obj;
383383 //System.out.println("material " + material);
384384 //Applet3D.tracein("selected ", selected);
385
- display.vector2buffer = obj.projectedVertices;
386
- display.DrawMaterial(material, selected);
385
+ //display.vector2buffer = obj.projectedVertices;
386
+ display.DrawMaterial(material, selected, obj.projectedVertices);
387387 }
388388 }
389389
....@@ -400,8 +400,8 @@
400400 materialdepth -= 1;
401401 if (materialdepth > 0)
402402 {
403
- display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
404
- display.DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1]);
403
+ //display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
404
+ display.DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1], cStatic.objectstack[materialdepth - 1].projectedVertices);
405405 }
406406 //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???");
407407 } else if (selected && CameraPane.flash && obj.GetMaterial() != null)
....@@ -421,8 +421,8 @@
421421 materialdepth -= 1;
422422 if (materialdepth > 0)
423423 {
424
- display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
425
- display.DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1]);
424
+ //display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
425
+ display.DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1], cStatic.objectstack[materialdepth - 1].projectedVertices);
426426 }
427427 //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???");
428428 //else
....@@ -1610,7 +1610,7 @@
16101610 // gl.glMaterialfv(gl.GL_BACK, gl.GL_DIFFUSE, colorV, 0);
16111611 }
16121612
1613
- void DrawMaterial(cMaterial material, boolean selected)
1613
+ void DrawMaterial(cMaterial material, boolean selected, Object3D.cVector2[] others)
16141614 {
16151615 CameraPane display = this;
16161616 //new Exception().printStackTrace();
....@@ -1645,7 +1645,7 @@
16451645 colorV[0] = display.modelParams0[0] * material.diffuse;
16461646 colorV[1] = display.modelParams0[1] * material.diffuse;
16471647 colorV[2] = display.modelParams0[2] * material.diffuse;
1648
- colorV[3] = material.opacity;
1648
+ colorV[3] = 1; // material.opacity;
16491649
16501650 gl.glColor4f(colorV[0], colorV[1], colorV[2], material.opacity);
16511651 //System.out.println("Opacity = " + opacity);
....@@ -1753,9 +1753,9 @@
17531753 display.modelParams7[2] = 0;
17541754 display.modelParams7[3] = 0;
17551755
1756
- display.modelParams6[0] = 100; // criss de bug de bump
1756
+ //display.modelParams6[0] = 100; // criss de bug de bump
17571757
1758
- Object3D.cVector2[] extparams = display.vector2buffer;
1758
+ Object3D.cVector2[] extparams = others; // display.vector2buffer;
17591759 if (extparams != null && extparams.length > 0 && extparams[0] != null)
17601760 {
17611761 display.modelParams6[0] = extparams[0].x / 1000.0f; // bump
....@@ -9366,11 +9366,35 @@
93669366 jy8[3] = 0.5f;
93679367 }
93689368
9369
- float[] options1 = new float[]{1000, 0.00001f, 20, 0, 0}; // focus, aperture, Shadow blur, aniso, anisoV
9369
+ float[] options1 = new float[]{100, 0.00001f, 20, 0, 0}; // focus, aperture, Shadow blur, aniso, anisoV
93709370 float[] options2 = new float[]{0, 1, 0, 0}; // fog density, intensity, elevation
93719371 float[] options3 = new float[]{1, 1, 1, 0}; // fog color
93729372 float[] options4 = new float[]{1, 0, 1, 0}; // image intensity, subsurface, lightsheen
93739373
9374
+ void ResetOptions()
9375
+ {
9376
+ options1[0] = 100;
9377
+ options1[1] = 0.00001f;
9378
+ options1[2] = 20;
9379
+ options1[3] = 0;
9380
+ options1[4] = 0;
9381
+
9382
+ options2[0] = 0;
9383
+ options2[1] = 1;
9384
+ options2[2] = 0;
9385
+ options2[3] = 0;
9386
+
9387
+ options3[0] = 1;
9388
+ options3[1] = 1;
9389
+ options3[2] = 1;
9390
+ options3[3] = 0;
9391
+
9392
+ options4[0] = 1;
9393
+ options4[1] = 0;
9394
+ options4[2] = 1;
9395
+ options4[3] = 0;
9396
+ }
9397
+
93749398 static int imagecount = 0; // movie generation
93759399
93769400 static int jitter = 0;
....@@ -10481,6 +10505,7 @@
1048110505 ANTIALIAS = 0;
1048210506 //System.out.println("RESTART");
1048310507 AAtimer.restart();
10508
+ Globals.TIMERRUNNING = true;
1048410509 }
1048510510 }
1048610511 }
....@@ -10548,7 +10573,8 @@
1054810573 ambientOcclusion = false;
1054910574 }
1055010575
10551
- if (Globals.lighttouched && DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN)
10576
+ if (//Globals.lighttouched &&
10577
+ DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN)
1055210578 {
1055310579 //if (RENDERSHADOW) // ?
1055410580 if (!IsFrozen())
....@@ -11458,7 +11484,7 @@
1145811484
1145911485 static boolean zoomonce = false;
1146011486
11461
- void CreateSelectedPoint()
11487
+ static void CreateSelectedPoint()
1146211488 {
1146311489 if (selectedpoint == null)
1146411490 {
....@@ -11478,6 +11504,9 @@
1147811504
1147911505 void DrawObject(GL gl, boolean draw)
1148011506 {
11507
+ // To clear camera values
11508
+ ResetOptions();
11509
+
1148111510 //System.out.println("DRAW OBJECT " + mouseDown);
1148211511 // DrawMode() = SELECTION;
1148311512 //GL gl = getGL();
....@@ -12045,7 +12074,7 @@
1204512074 for (int i = tp.size(); --i >= 0;)
1204612075 {
1204712076 //for (int count = tp.get(i).GetTransformCount(); --count>=0;)
12048
- LA.xformPos(light, tp.get(i).GlobalTransform(), light);
12077
+ LA.xformPos(light, tp.get(i).GlobalTransformInv(), light);
1204912078 }
1205012079
1205112080
....@@ -13315,7 +13344,8 @@
1331513344 /*static*/ float[] modelParams5 = new float[]{0, 0, 0, 0}; // texture, opacity, fakedepth, shadowbias
1331613345 /*static*/ float[] modelParams6 = new float[]{0, 0, 0, 0}; // bump, noise, borderfade, fog punchthrough
1331713346 /*static*/ float[] modelParams7 = new float[]{0, 0, 0, 0}; // noise power, opacity power
13318
- Object3D.cVector2[] vector2buffer;
13347
+
13348
+ //Object3D.cVector2[] vector2buffer;
1331913349
1332013350 // IN : ndotl, ndoth, xxx, NdotL //, snininess, lightarea
1332113351 // OUT : diff, spec
....@@ -13838,6 +13868,7 @@
1383813868 else
1383913869 if (evt.getSource() == AAtimer)
1384013870 {
13871
+ Globals.TIMERRUNNING = false;
1384113872 if (mouseDown)
1384213873 {
1384313874 //new Exception().printStackTrace();
....@@ -13912,6 +13943,7 @@
1391213943 return;
1391313944
1391413945 AAtimer.restart(); //
13946
+ Globals.TIMERRUNNING = true;
1391513947
1391613948 // waslive = LIVE;
1391713949 // LIVE = false;
....@@ -14375,7 +14407,8 @@
1437514407 info.camera = renderCamera;
1437614408 info.x = x;
1437714409 info.y = y;
14378
- object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
14410
+ object.GetWindow().copy
14411
+ .doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
1437914412 } else
1438014413 {
1438114414 if (x < startX)
....@@ -14539,7 +14572,9 @@
1453914572 ci.camera = renderCamera;
1454014573 if (!isRenderer)
1454114574 {
14542
- if (object.editWindow.copy.doEditClick(ci, 0))
14575
+ //ObjEditor editWindow = object.editWindow;
14576
+ //Object3D copy = editWindow.copy;
14577
+ if (object.doEditClick(ci, 0))
1454314578 {
1454414579 setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
1454514580 } else
....@@ -15373,7 +15408,7 @@
1537315408 }
1537415409 */
1537515410
15376
- object.editWindow.EditSelection();
15411
+ object.editWindow.EditSelection(false);
1537715412 }
1537815413
1537915414 void SelectParent()
....@@ -16385,16 +16420,16 @@
1638516420 cStatic.objectstack[materialdepth++] = checker;
1638616421 //System.out.println("material " + material);
1638716422 //Applet3D.tracein(this, selected);
16388
- vector2buffer = checker.projectedVertices;
16423
+ //vector2buffer = checker.projectedVertices;
1638916424
1639016425 //checker.GetMaterial().Draw(this, false); // true);
16391
- DrawMaterial(checker.GetMaterial(), false); // true);
16426
+ DrawMaterial(checker.GetMaterial(), false, checker.projectedVertices); // true);
1639216427
1639316428 materialdepth -= 1;
1639416429 if (materialdepth > 0)
1639516430 {
16396
- vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
16397
- DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1]);
16431
+ //vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
16432
+ DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1], cStatic.objectstack[materialdepth - 1].projectedVertices);
1639816433 }
1639916434 //checker.GetMaterial().opacity = 1f;
1640016435 ////checker.GetMaterial().ambient = 1f;
....@@ -16618,6 +16653,8 @@
1661816653 // System.err.println("view = " + view[8] + " " + view[9] + " " + view[10] + " " + view[11]);
1661916654 // System.err.println("view = " + view[12] + " " + view[13] + " " + view[14] + " " + view[15]);
1662016655
16656
+ CreateSelectedPoint();
16657
+
1662116658 // Will fit the mesh !!!
1662216659 selectedpoint.toParent[0][0] = 0.0001;
1662316660 selectedpoint.toParent[1][1] = 0.0001;