Normand Briere
2019-06-25 ecff440ceef3ad352aa64cedbb913107ec4863a5
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
....@@ -327,7 +326,7 @@
327326 cStatic.objectstack[materialdepth++] = obj;
328327 //System.out.println("material " + material);
329328 //Applet3D.tracein(this, selected);
330
- display.vector2buffer = obj.projectedVertices;
329
+ //display.vector2buffer = obj.projectedVertices;
331330 if (obj instanceof Camera)
332331 {
333332 display.options1[0] = material.shift;
....@@ -359,7 +358,7 @@
359358 /**/
360359 } else
361360 {
362
- DrawMaterial(material, selected);
361
+ DrawMaterial(material, selected, obj.projectedVertices);
363362 }
364363 } else
365364 {
....@@ -383,8 +382,8 @@
383382 cStatic.objectstack[materialdepth++] = obj;
384383 //System.out.println("material " + material);
385384 //Applet3D.tracein("selected ", selected);
386
- display.vector2buffer = obj.projectedVertices;
387
- display.DrawMaterial(material, selected);
385
+ //display.vector2buffer = obj.projectedVertices;
386
+ display.DrawMaterial(material, selected, obj.projectedVertices);
388387 }
389388 }
390389
....@@ -401,8 +400,8 @@
401400 materialdepth -= 1;
402401 if (materialdepth > 0)
403402 {
404
- display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
405
- 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);
406405 }
407406 //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???");
408407 } else if (selected && CameraPane.flash && obj.GetMaterial() != null)
....@@ -422,8 +421,8 @@
422421 materialdepth -= 1;
423422 if (materialdepth > 0)
424423 {
425
- display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
426
- 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);
427426 }
428427 //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???");
429428 //else
....@@ -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 }
....@@ -1603,7 +1610,7 @@
16031610 // gl.glMaterialfv(gl.GL_BACK, gl.GL_DIFFUSE, colorV, 0);
16041611 }
16051612
1606
- void DrawMaterial(cMaterial material, boolean selected)
1613
+ void DrawMaterial(cMaterial material, boolean selected, Object3D.cVector2[] others)
16071614 {
16081615 CameraPane display = this;
16091616 //new Exception().printStackTrace();
....@@ -1638,7 +1645,7 @@
16381645 colorV[0] = display.modelParams0[0] * material.diffuse;
16391646 colorV[1] = display.modelParams0[1] * material.diffuse;
16401647 colorV[2] = display.modelParams0[2] * material.diffuse;
1641
- colorV[3] = material.opacity;
1648
+ colorV[3] = 1; // material.opacity;
16421649
16431650 gl.glColor4f(colorV[0], colorV[1], colorV[2], material.opacity);
16441651 //System.out.println("Opacity = " + opacity);
....@@ -1746,9 +1753,9 @@
17461753 display.modelParams7[2] = 0;
17471754 display.modelParams7[3] = 0;
17481755
1749
- display.modelParams6[0] = 100; // criss de bug de bump
1756
+ //display.modelParams6[0] = 100; // criss de bug de bump
17501757
1751
- Object3D.cVector2[] extparams = display.vector2buffer;
1758
+ Object3D.cVector2[] extparams = others; // display.vector2buffer;
17521759 if (extparams != null && extparams.length > 0 && extparams[0] != null)
17531760 {
17541761 display.modelParams6[0] = extparams[0].x / 1000.0f; // bump
....@@ -1890,7 +1897,7 @@
18901897 void PushMatrix(double[][] matrix)
18911898 {
18921899 // GrafreeD.tracein(matrix);
1893
- PushMatrix(matrix,1);
1900
+ PushMatrix(matrix, 1);
18941901 }
18951902
18961903 void PushMatrix()
....@@ -2259,7 +2266,7 @@
22592266
22602267 void ToggleDebug()
22612268 {
2262
- DEBUG ^= true;
2269
+ Globals.DEBUG ^= true;
22632270 }
22642271
22652272 void ToggleLookAt()
....@@ -7921,6 +7928,64 @@
79217928 ReleaseTexture(pigment, false);
79227929 }
79237930
7931
+ public void ReleasePigmentTexture(cTexture tex) // INTERFACE
7932
+ {
7933
+ if (/*tex == null ||*/ ambientOcclusion ) // || !textureon)
7934
+ {
7935
+ return;
7936
+ }
7937
+
7938
+ if (tex == null)
7939
+ {
7940
+ ReleaseTexture(null, false);
7941
+ return;
7942
+ }
7943
+
7944
+ String pigment = Object3D.GetPigment(tex);
7945
+
7946
+ if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
7947
+ {
7948
+ // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment);
7949
+ // System.out.println("; bump = " + bump);
7950
+ }
7951
+
7952
+ if (pigment.equals(""))
7953
+ {
7954
+ pigment = null;
7955
+ }
7956
+
7957
+ ReleaseTexture(pigment, false);
7958
+ }
7959
+
7960
+ public void ReleaseBumpTexture(cTexture tex) // INTERFACE
7961
+ {
7962
+ if (/*tex == null ||*/ ambientOcclusion ) // || !textureon)
7963
+ {
7964
+ return;
7965
+ }
7966
+
7967
+ if (tex == null)
7968
+ {
7969
+ ReleaseTexture(null, true);
7970
+ return;
7971
+ }
7972
+
7973
+ String bump = Object3D.GetBump(tex);
7974
+
7975
+ if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
7976
+ {
7977
+ // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment);
7978
+ // System.out.println("; bump = " + bump);
7979
+ }
7980
+
7981
+ if (bump.equals(""))
7982
+ {
7983
+ bump = null;
7984
+ }
7985
+
7986
+ ReleaseTexture(bump, true);
7987
+ }
7988
+
79247989 void ReleaseTexture(String tex, boolean bump)
79257990 {
79267991 if (// DrawMode() != 0 || /*tex == null ||*/
....@@ -8067,6 +8132,73 @@
80678132 GetGL().glActiveTexture(GetGL().GL_TEXTURE0);
80688133
80698134 return; // true;
8135
+ }
8136
+
8137
+ /*boolean*/ public void BindPigmentTexture(cTexture tex, int resolution) throws Exception // INTERFACE
8138
+ {
8139
+ if (// DrawMode() != 0 || /*tex == null ||*/
8140
+ ambientOcclusion ) // || !textureon)
8141
+ {
8142
+ return; // false;
8143
+ }
8144
+
8145
+ if (tex == null)
8146
+ {
8147
+ BindTexture(null,false,resolution);
8148
+ return;
8149
+ }
8150
+
8151
+ String pigment = Object3D.GetPigment(tex);
8152
+
8153
+ usedtextures.put(pigment, pigment);
8154
+
8155
+ if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
8156
+ {
8157
+ // System.out.print("BIND +++++++++++++++ pigment = " + pigment);
8158
+ // System.out.println("; bump = " + bump);
8159
+ }
8160
+
8161
+ if (pigment.equals(""))
8162
+ {
8163
+ pigment = null;
8164
+ }
8165
+
8166
+ GetGL().glActiveTexture(GetGL().GL_TEXTURE0);
8167
+ BindTexture(pigment, false, resolution);
8168
+ }
8169
+
8170
+ /*boolean*/ public void BindBumpTexture(cTexture tex, int resolution) throws Exception // INTERFACE
8171
+ {
8172
+ if (// DrawMode() != 0 || /*tex == null ||*/
8173
+ ambientOcclusion ) // || !textureon)
8174
+ {
8175
+ return; // false;
8176
+ }
8177
+
8178
+ if (tex == null)
8179
+ {
8180
+ BindTexture(null,true,resolution);
8181
+ return;
8182
+ }
8183
+
8184
+ String bump = Object3D.GetBump(tex);
8185
+
8186
+ usedtextures.put(bump, bump);
8187
+
8188
+ if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
8189
+ {
8190
+ // System.out.print("BIND +++++++++++++++ pigment = " + pigment);
8191
+ // System.out.println("; bump = " + bump);
8192
+ }
8193
+
8194
+ if (bump.equals(""))
8195
+ {
8196
+ bump = null;
8197
+ }
8198
+
8199
+ GetGL().glActiveTexture(GetGL().GL_TEXTURE2);
8200
+ BindTexture(bump, true, resolution);
8201
+ GetGL().glActiveTexture(GetGL().GL_TEXTURE0);
80708202 }
80718203
80728204 java.util.HashSet<String> missingTextures = new java.util.HashSet<String>();
....@@ -9234,11 +9366,35 @@
92349366 jy8[3] = 0.5f;
92359367 }
92369368
9237
- 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
92389370 float[] options2 = new float[]{0, 1, 0, 0}; // fog density, intensity, elevation
92399371 float[] options3 = new float[]{1, 1, 1, 0}; // fog color
92409372 float[] options4 = new float[]{1, 0, 1, 0}; // image intensity, subsurface, lightsheen
92419373
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
+
92429398 static int imagecount = 0; // movie generation
92439399
92449400 static int jitter = 0;
....@@ -9335,7 +9491,7 @@
93359491
93369492 if (renderCamera != lightCamera)
93379493 //for (int count = parentcam.GetTransformCount(); --count>=0;)
9338
- LA.matConcat(matrix, parentcam.GlobalTransformInv(), matrix);
9494
+ LA.matConcat(matrix, parentcam.GlobalTransform(), matrix);
93399495
93409496 // LA.matConcat(renderCamera.toScreen, renderCamera.toParent, matrix);
93419497
....@@ -9351,7 +9507,7 @@
93519507
93529508 if (renderCamera != lightCamera)
93539509 //for (int count = parentcam.GetTransformCount(); --count>=0;)
9354
- LA.matConcat(parentcam.GlobalTransform(), matrix, matrix);
9510
+ LA.matConcat(parentcam.GlobalTransformInv(), matrix, matrix);
93559511
93569512 // LA.matConcat(renderCamera.fromParent, renderCamera.fromScreen, matrix);
93579513
....@@ -10349,6 +10505,7 @@
1034910505 ANTIALIAS = 0;
1035010506 //System.out.println("RESTART");
1035110507 AAtimer.restart();
10508
+ Globals.TIMERRUNNING = true;
1035210509 }
1035310510 }
1035410511 }
....@@ -10416,7 +10573,8 @@
1041610573 ambientOcclusion = false;
1041710574 }
1041810575
10419
- if (Globals.lighttouched && DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN)
10576
+ if (//Globals.lighttouched &&
10577
+ DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN)
1042010578 {
1042110579 //if (RENDERSHADOW) // ?
1042210580 if (!IsFrozen())
....@@ -10550,7 +10708,7 @@
1055010708 // if (parentcam != renderCamera) // not a light
1055110709 if (cam != lightCamera)
1055210710 //for (int count = parentcam.GetTransformCount(); --count>=0;)
10553
- LA.matConcat(matrix, parentcam.GlobalTransformInv(), matrix);
10711
+ LA.matConcat(matrix, parentcam.GlobalTransform(), matrix);
1055410712
1055510713 for (int j = 0; j < 4; j++)
1055610714 {
....@@ -10565,7 +10723,7 @@
1056510723 // if (parentcam != renderCamera) // not a light
1056610724 if (cam != lightCamera)
1056710725 //for (int count = parentcam.GetTransformCount(); --count>=0;)
10568
- LA.matConcat(parentcam.GlobalTransform(), matrix, matrix);
10726
+ LA.matConcat(parentcam.GlobalTransformInv(), matrix, matrix);
1056910727
1057010728 //LA.matConcat(cam.fromScreen, parentcam.fromParent, matrix);
1057110729
....@@ -10959,7 +11117,7 @@
1095911117
1096011118 // if (cam != lightCamera)
1096111119 //for (int count = parentcam.GetTransformCount(); --count>=0;)
10962
- LA.xformDir(lightposition, parentcam.GlobalTransformInv(), lightposition); // may 2013
11120
+ LA.xformDir(lightposition, parentcam.GlobalTransform(), lightposition); // may 2013
1096311121 }
1096411122
1096511123 LA.xformDir(lightposition, cam.toScreen, lightposition);
....@@ -10981,7 +11139,7 @@
1098111139 {
1098211140 if (cam != lightCamera)
1098311141 //for (int count = parentcam.GetTransformCount(); --count>=0;)
10984
- LA.xformDir(light0, parentcam.GlobalTransformInv(), light0); // may 2013
11142
+ LA.xformDir(light0, parentcam.GlobalTransform(), light0); // may 2013
1098511143 }
1098611144
1098711145 LA.xformPos(light0, cam.toScreen, light0);
....@@ -11326,8 +11484,29 @@
1132611484
1132711485 static boolean zoomonce = false;
1132811486
11487
+ static void CreateSelectedPoint()
11488
+ {
11489
+ if (selectedpoint == null)
11490
+ {
11491
+ debugpointG = new Sphere();
11492
+ debugpointP = new Sphere();
11493
+ debugpointC = new Sphere();
11494
+ debugpointR = new Sphere();
11495
+
11496
+ selectedpoint = new Superellipsoid();
11497
+
11498
+ for (int i=0; i<8; i++)
11499
+ {
11500
+ debugpoints[i] = new Sphere();
11501
+ }
11502
+ }
11503
+ }
11504
+
1132911505 void DrawObject(GL gl, boolean draw)
1133011506 {
11507
+ // To clear camera values
11508
+ ResetOptions();
11509
+
1133111510 //System.out.println("DRAW OBJECT " + mouseDown);
1133211511 // DrawMode() = SELECTION;
1133311512 //GL gl = getGL();
....@@ -11406,8 +11585,9 @@
1140611585
1140711586 if (DrawMode() == DEFAULT)
1140811587 {
11409
- if (DEBUG)
11588
+ if (Globals.DEBUG)
1141011589 {
11590
+ CreateSelectedPoint();
1141111591 float radius = 0.05f;
1141211592 if (selectedpoint.radius != radius)
1141311593 {
....@@ -11912,7 +12092,7 @@
1191212092 }
1191312093
1191412094 //for (int count = parentcam.GetTransformCount(); --count>=0;)
11915
- LA.xformPos(light, parentcam.GlobalTransformInv(), light); // may 2013
12095
+ LA.xformPos(light, parentcam.GlobalTransform(), light); // may 2013
1191612096
1191712097 LA.xformPos(light, renderCamera.toScreen, light);
1191812098
....@@ -13164,7 +13344,8 @@
1316413344 /*static*/ float[] modelParams5 = new float[]{0, 0, 0, 0}; // texture, opacity, fakedepth, shadowbias
1316513345 /*static*/ float[] modelParams6 = new float[]{0, 0, 0, 0}; // bump, noise, borderfade, fog punchthrough
1316613346 /*static*/ float[] modelParams7 = new float[]{0, 0, 0, 0}; // noise power, opacity power
13167
- Object3D.cVector2[] vector2buffer;
13347
+
13348
+ //Object3D.cVector2[] vector2buffer;
1316813349
1316913350 // IN : ndotl, ndoth, xxx, NdotL //, snininess, lightarea
1317013351 // OUT : diff, spec
....@@ -13687,6 +13868,7 @@
1368713868 else
1368813869 if (evt.getSource() == AAtimer)
1368913870 {
13871
+ Globals.TIMERRUNNING = false;
1369013872 if (mouseDown)
1369113873 {
1369213874 //new Exception().printStackTrace();
....@@ -13761,6 +13943,7 @@
1376113943 return;
1376213944
1376313945 AAtimer.restart(); //
13946
+ Globals.TIMERRUNNING = true;
1376413947
1376513948 // waslive = LIVE;
1376613949 // LIVE = false;
....@@ -13833,6 +14016,8 @@
1383314016
1383414017 public void mouseDragged(MouseEvent e)
1383514018 {
14019
+ Globals.MOUSEDRAGGED = true;
14020
+
1383614021 //System.out.println("mouseDragged: " + e);
1383714022 if (isRenderer)
1383814023 movingcamera = true;
....@@ -14222,7 +14407,8 @@
1422214407 info.camera = renderCamera;
1422314408 info.x = x;
1422414409 info.y = y;
14225
- object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
14410
+ object.GetWindow().copy
14411
+ .doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
1422614412 } else
1422714413 {
1422814414 if (x < startX)
....@@ -14386,7 +14572,9 @@
1438614572 ci.camera = renderCamera;
1438714573 if (!isRenderer)
1438814574 {
14389
- if (object.editWindow.copy.doEditClick(ci, 0))
14575
+ //ObjEditor editWindow = object.editWindow;
14576
+ //Object3D copy = editWindow.copy;
14577
+ if (object.doEditClick(ci, 0))
1439014578 {
1439114579 setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
1439214580 } else
....@@ -14398,6 +14586,8 @@
1439814586
1439914587 public void mouseReleased(MouseEvent e)
1440014588 {
14589
+ Globals.MOUSEDRAGGED = false;
14590
+
1440114591 movingcamera = false;
1440214592 X = Y = 0;
1440314593 //System.out.println("mouseReleased: " + e);
....@@ -14765,8 +14955,14 @@
1476514955 RevertCamera();
1476614956 repaint();
1476714957 break;
14768
- case 'L':
1476914958 case 'l':
14959
+ lightMode ^= true;
14960
+ Globals.lighttouched = true;
14961
+ manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;
14962
+ targetLookAt.set(manipCamera.lookAt);
14963
+ repaint();
14964
+ break;
14965
+ case 'L':
1477014966 if (lightMode)
1477114967 {
1477214968 lightMode = false;
....@@ -14913,16 +15109,14 @@
1491315109 kompactbit = 6;
1491415110 break;
1491515111 case ' ':
14916
- lightMode ^= true;
14917
- Globals.lighttouched = true;
14918
- manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;
14919
- targetLookAt.set(manipCamera.lookAt);
15112
+ ObjEditor.theFrame.ToggleFullScreen();
1492015113 repaint();
1492115114 break;
1492215115 //case '`' :
1492315116 case ESC:
1492415117 RENDERPROGRAM += 1;
1492515118 RENDERPROGRAM %= 3;
15119
+
1492615120 repaint();
1492715121 break;
1492815122 case 'Z':
....@@ -15214,7 +15408,7 @@
1521415408 }
1521515409 */
1521615410
15217
- object.editWindow.EditSelection();
15411
+ object.editWindow.EditSelection(false);
1521815412 }
1521915413
1522015414 void SelectParent()
....@@ -15513,12 +15707,17 @@
1551315707 {
1551415708 switch (object.selection.get(0).hitSomething)
1551515709 {
15516
- case Object3D.hitCenter: gr.setColor(Color.pink); break;
15517
- case Object3D.hitRotate: gr.setColor(Color.green); break;
15518
- case Object3D.hitScale: gr.setColor(Color.cyan); break;
15710
+ case Object3D.hitCenter: gr.setColor(Color.pink);
15711
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15712
+ break;
15713
+ case Object3D.hitRotate: gr.setColor(Color.yellow);
15714
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15715
+ break;
15716
+ case Object3D.hitScale: gr.setColor(Color.cyan);
15717
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15718
+ break;
1551915719 }
1552015720
15521
- gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
1552215721 }
1552315722 }
1552415723 }
....@@ -16221,16 +16420,16 @@
1622116420 cStatic.objectstack[materialdepth++] = checker;
1622216421 //System.out.println("material " + material);
1622316422 //Applet3D.tracein(this, selected);
16224
- vector2buffer = checker.projectedVertices;
16423
+ //vector2buffer = checker.projectedVertices;
1622516424
1622616425 //checker.GetMaterial().Draw(this, false); // true);
16227
- DrawMaterial(checker.GetMaterial(), false); // true);
16426
+ DrawMaterial(checker.GetMaterial(), false, checker.projectedVertices); // true);
1622816427
1622916428 materialdepth -= 1;
1623016429 if (materialdepth > 0)
1623116430 {
16232
- vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
16233
- 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);
1623416433 }
1623516434 //checker.GetMaterial().opacity = 1f;
1623616435 ////checker.GetMaterial().ambient = 1f;
....@@ -16453,6 +16652,8 @@
1645316652 // System.err.println("view = " + view[4] + " " + view[5] + " " + view[6] + " " + view[7]);
1645416653 // System.err.println("view = " + view[8] + " " + view[9] + " " + view[10] + " " + view[11]);
1645516654 // System.err.println("view = " + view[12] + " " + view[13] + " " + view[14] + " " + view[15]);
16655
+
16656
+ CreateSelectedPoint();
1645616657
1645716658 // Will fit the mesh !!!
1645816659 selectedpoint.toParent[0][0] = 0.0001;
....@@ -17093,23 +17294,15 @@
1709317294 int AAbuffersize = 0;
1709417295
1709517296 //double[] selectedpoint = new double[3];
17096
- static Superellipsoid selectedpoint = new Superellipsoid();
17297
+ static Superellipsoid selectedpoint;
1709717298 static Sphere previousselectedpoint = null;
17098
- static Sphere debugpointG = new Sphere();
17099
- static Sphere debugpointP = new Sphere();
17100
- static Sphere debugpointC = new Sphere();
17101
- static Sphere debugpointR = new Sphere();
17299
+ static Sphere debugpointG;
17300
+ static Sphere debugpointP;
17301
+ static Sphere debugpointC;
17302
+ static Sphere debugpointR;
1710217303
1710317304 static Sphere debugpoints[] = new Sphere[8];
1710417305
17105
- static
17106
- {
17107
- for (int i=0; i<8; i++)
17108
- {
17109
- debugpoints[i] = new Sphere();
17110
- }
17111
- }
17112
-
1711317306 static void InitPoints(float radius)
1711417307 {
1711517308 for (int i=0; i<8; i++)