Normand Briere
2019-06-30 cfd7a643cb5a445016ddb15595158ecc59b184fd
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;
....@@ -336,14 +335,28 @@
336335 display.options1[2] = material.shadowbias;
337336 display.options1[3] = material.aniso;
338337 display.options1[4] = material.anisoV;
338
+// System.out.println("display.options1[0] " + display.options1[0]);
339
+// System.out.println("display.options1[1] " + display.options1[1]);
340
+// System.out.println("display.options1[2] " + display.options1[2]);
341
+// System.out.println("display.options1[3] " + display.options1[3]);
342
+// System.out.println("display.options1[4] " + display.options1[4]);
339343 display.options2[0] = material.opacity;
340344 display.options2[1] = material.diffuse;
341345 display.options2[2] = material.factor;
346
+// System.out.println("display.options2[0] " + display.options2[0]);
347
+// System.out.println("display.options2[1] " + display.options2[1]);
348
+// System.out.println("display.options2[2] " + display.options2[2]);
342349
343350 cColor.HSBtoRGB(material.color, material.modulation, 1, display.options3);
351
+// System.out.println("display.options3[0] " + display.options3[0]);
352
+// System.out.println("display.options3[1] " + display.options3[1]);
353
+// System.out.println("display.options3[2] " + display.options3[2]);
344354 display.options4[0] = material.cameralight/0.2f;
345355 display.options4[1] = material.subsurface;
346356 display.options4[2] = material.sheen;
357
+// System.out.println("display.options4[0] " + display.options4[0]);
358
+// System.out.println("display.options4[1] " + display.options4[1]);
359
+// System.out.println("display.options4[2] " + display.options4[2]);
347360
348361 // if (display.CURRENTANTIALIAS > 0)
349362 // display.options3[3] /= 4;
....@@ -359,7 +372,7 @@
359372 /**/
360373 } else
361374 {
362
- DrawMaterial(material, selected);
375
+ DrawMaterial(material, selected, obj.projectedVertices);
363376 }
364377 } else
365378 {
....@@ -383,8 +396,8 @@
383396 cStatic.objectstack[materialdepth++] = obj;
384397 //System.out.println("material " + material);
385398 //Applet3D.tracein("selected ", selected);
386
- display.vector2buffer = obj.projectedVertices;
387
- display.DrawMaterial(material, selected);
399
+ //display.vector2buffer = obj.projectedVertices;
400
+ display.DrawMaterial(material, selected, obj.projectedVertices);
388401 }
389402 }
390403
....@@ -401,8 +414,8 @@
401414 materialdepth -= 1;
402415 if (materialdepth > 0)
403416 {
404
- display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
405
- display.DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1]);
417
+ //display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
418
+ display.DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1], cStatic.objectstack[materialdepth - 1].projectedVertices);
406419 }
407420 //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???");
408421 } else if (selected && CameraPane.flash && obj.GetMaterial() != null)
....@@ -422,8 +435,8 @@
422435 materialdepth -= 1;
423436 if (materialdepth > 0)
424437 {
425
- display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
426
- display.DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1]);
438
+ //display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
439
+ display.DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1], cStatic.objectstack[materialdepth - 1].projectedVertices);
427440 }
428441 //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???");
429442 //else
....@@ -464,10 +477,12 @@
464477 if (!selectmode) // display.drawMode != display.SELECTION) // && display.drawMode != display.SHADOW) // (attributes & FILL) != 0)
465478 {
466479 //gl.glBegin(gl.GL_TRIANGLES);
467
- boolean hasnorm = pv.norm != null && (pv.norm.x != 0 || pv.norm.y != 0 || pv.norm.z != 0);
480
+ boolean hasnorm = pv.norm != null && (pv.norm.x != 0 || pv.norm.y != 0 || pv.norm.z != 0)
481
+ // TEST LIVE NORMALS && !obj.dontselect
482
+ ;
468483 if (!hasnorm)
469484 {
470
- // System.out.println("FUCK!!");
485
+ // System.out.println("Mesh normal");
471486 LA.vecSub(pv/*.pos*/, qv/*.pos*/, obj.v0);
472487 LA.vecSub(pv/*.pos*/, rv/*.pos*/, obj.v1);
473488 LA.vecCross(obj.v0, obj.v1, obj.v2);
....@@ -1192,10 +1207,12 @@
11921207 gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
11931208 }
11941209 }
1210
+
11951211 if (flipV)
11961212 gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
11971213 else
11981214 gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
1215
+
11991216 //System.out.println("vertex1 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]);
12001217 gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
12011218
....@@ -1215,10 +1232,12 @@
12151232 gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
12161233 }
12171234 }
1235
+
12181236 if (flipV)
12191237 gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
12201238 else
12211239 gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
1240
+
12221241 //System.out.println("vertex2 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]);
12231242 gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
12241243
....@@ -1246,8 +1265,10 @@
12461265 gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
12471266 else
12481267 gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
1268
+
12491269 //System.out.println("coord3 = " + uv[count2] + ", " + uv[count2+1]);
12501270 gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
1271
+
12511272 count2 += 2;
12521273 count3 += 3;
12531274 }
....@@ -1603,7 +1624,7 @@
16031624 // gl.glMaterialfv(gl.GL_BACK, gl.GL_DIFFUSE, colorV, 0);
16041625 }
16051626
1606
- void DrawMaterial(cMaterial material, boolean selected)
1627
+ void DrawMaterial(cMaterial material, boolean selected, Object3D.cVector2[] others)
16071628 {
16081629 CameraPane display = this;
16091630 //new Exception().printStackTrace();
....@@ -1638,7 +1659,7 @@
16381659 colorV[0] = display.modelParams0[0] * material.diffuse;
16391660 colorV[1] = display.modelParams0[1] * material.diffuse;
16401661 colorV[2] = display.modelParams0[2] * material.diffuse;
1641
- colorV[3] = material.opacity;
1662
+ colorV[3] = 1; // material.opacity;
16421663
16431664 gl.glColor4f(colorV[0], colorV[1], colorV[2], material.opacity);
16441665 //System.out.println("Opacity = " + opacity);
....@@ -1746,9 +1767,9 @@
17461767 display.modelParams7[2] = 0;
17471768 display.modelParams7[3] = 0;
17481769
1749
- display.modelParams6[0] = 100; // criss de bug de bump
1770
+ //display.modelParams6[0] = 100; // criss de bug de bump
17501771
1751
- Object3D.cVector2[] extparams = display.vector2buffer;
1772
+ Object3D.cVector2[] extparams = others; // display.vector2buffer;
17521773 if (extparams != null && extparams.length > 0 && extparams[0] != null)
17531774 {
17541775 display.modelParams6[0] = extparams[0].x / 1000.0f; // bump
....@@ -2259,7 +2280,7 @@
22592280
22602281 void ToggleDebug()
22612282 {
2262
- DEBUG ^= true;
2283
+ Globals.DEBUG ^= true;
22632284 }
22642285
22652286 void ToggleLookAt()
....@@ -2375,6 +2396,128 @@
23752396 public GL GetGL() // INTERFACE
23762397 {
23772398 return currentGL;
2399
+ }
2400
+
2401
+ private void GetRemoteZip(String url, String name, boolean unzip, boolean save)
2402
+ {
2403
+ java.net.URL u;
2404
+ InputStream is = null;
2405
+ DataInputStream dis;
2406
+ java.util.zip.ZipInputStream zis;
2407
+ //String s;
2408
+
2409
+ System.out.println("GetRemoteZip " + name);
2410
+
2411
+ int total = 0; // dis.available();
2412
+
2413
+ byte[] bytes = new byte[16384];
2414
+
2415
+ try
2416
+ {
2417
+ u = new java.net.URL(url + name);
2418
+ is = u.openStream();
2419
+
2420
+ System.out.println(url + name);
2421
+
2422
+ if (unzip)
2423
+ {
2424
+ //dis = new DataInputStream(new BufferedInputStream(is));
2425
+ zis = new java.util.zip.ZipInputStream(new BufferedInputStream(is));
2426
+ //while ((s = dis.readLine()) != null)
2427
+
2428
+ if (save)
2429
+ new java.io.File(name).mkdirs();
2430
+
2431
+ // FileOutputStream stream = new FileOutputStream("test.zip");
2432
+ //
2433
+ // int count;
2434
+ //
2435
+ // while ((count = dis.read(bytes)) != -1)
2436
+ // {
2437
+ // //System.out.println(s);
2438
+ // System.out.println(count);
2439
+ // total += count;
2440
+ // stream.write(bytes);
2441
+ // }
2442
+ //
2443
+ // stream.close();
2444
+
2445
+ // now iterate through each item in the stream. The get next
2446
+ // entry call will return a ZipEntry for each file in the
2447
+ // stream
2448
+ java.util.zip.ZipEntry entry;
2449
+ while((entry = zis.getNextEntry())!=null)
2450
+ {
2451
+ if (entry.getName().endsWith(".gsm"))
2452
+ {
2453
+ continue;
2454
+ }
2455
+
2456
+ String s = String.format("Entry: %s len %d added %TD",
2457
+ entry.getName(), entry.getSize(),
2458
+ new java.util.Date(entry.getTime()));
2459
+ System.out.println(s);
2460
+
2461
+ if (save)
2462
+ {
2463
+ // Once we get the entry from the stream, the stream is
2464
+ // positioned read to read the raw data, and we keep
2465
+ // reading until read returns 0 or less.
2466
+ String outpath = name + "/" + entry.getName();
2467
+ FileOutputStream output = null;
2468
+ try
2469
+ {
2470
+ output = new FileOutputStream(outpath);
2471
+ int len = 0;
2472
+ while ((len = zis.read(bytes)) > 0)
2473
+ {
2474
+ output.write(bytes, 0, len);
2475
+ }
2476
+ }
2477
+ finally
2478
+ {
2479
+ // we must always close the output file
2480
+ if(output!=null) output.close();
2481
+ }
2482
+ }
2483
+ }
2484
+ }
2485
+ }
2486
+ catch (java.net.MalformedURLException mue)
2487
+ {
2488
+ System.err.println("Ouch - a MalformedURLException happened.");
2489
+ mue.printStackTrace();
2490
+ //System.exit(2);
2491
+ }
2492
+ catch (IOException ioe)
2493
+ {
2494
+ //System.err.println("Oops - an IOException happened.");
2495
+ //ioe.printStackTrace();
2496
+ //System.exit(3);
2497
+ }
2498
+ finally
2499
+ {
2500
+ try
2501
+ {
2502
+ if (is != null)
2503
+ is.close();
2504
+ }
2505
+ catch (IOException ioe)
2506
+ {
2507
+ }
2508
+ }
2509
+
2510
+ // System.out.println("length = " + total);
2511
+
2512
+// try
2513
+// {
2514
+// Runtime.getRuntime().exec("/usr/local/bin/wget https://archive3d.net/?a=download&do=get&id=7caca905");
2515
+// }
2516
+// catch (Exception e)
2517
+// {
2518
+// e.printStackTrace();
2519
+// }
2520
+
23782521 }
23792522
23802523 /**/
....@@ -7921,6 +8064,64 @@
79218064 ReleaseTexture(pigment, false);
79228065 }
79238066
8067
+ public void ReleasePigmentTexture(cTexture tex) // INTERFACE
8068
+ {
8069
+ if (/*tex == null ||*/ ambientOcclusion ) // || !textureon)
8070
+ {
8071
+ return;
8072
+ }
8073
+
8074
+ if (tex == null)
8075
+ {
8076
+ ReleaseTexture(null, false);
8077
+ return;
8078
+ }
8079
+
8080
+ String pigment = Object3D.GetPigment(tex);
8081
+
8082
+ if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
8083
+ {
8084
+ // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment);
8085
+ // System.out.println("; bump = " + bump);
8086
+ }
8087
+
8088
+ if (pigment.equals(""))
8089
+ {
8090
+ pigment = null;
8091
+ }
8092
+
8093
+ ReleaseTexture(pigment, false);
8094
+ }
8095
+
8096
+ public void ReleaseBumpTexture(cTexture tex) // INTERFACE
8097
+ {
8098
+ if (/*tex == null ||*/ ambientOcclusion ) // || !textureon)
8099
+ {
8100
+ return;
8101
+ }
8102
+
8103
+ if (tex == null)
8104
+ {
8105
+ ReleaseTexture(null, true);
8106
+ return;
8107
+ }
8108
+
8109
+ String bump = Object3D.GetBump(tex);
8110
+
8111
+ if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
8112
+ {
8113
+ // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment);
8114
+ // System.out.println("; bump = " + bump);
8115
+ }
8116
+
8117
+ if (bump.equals(""))
8118
+ {
8119
+ bump = null;
8120
+ }
8121
+
8122
+ ReleaseTexture(bump, true);
8123
+ }
8124
+
79248125 void ReleaseTexture(String tex, boolean bump)
79258126 {
79268127 if (// DrawMode() != 0 || /*tex == null ||*/
....@@ -8067,6 +8268,73 @@
80678268 GetGL().glActiveTexture(GetGL().GL_TEXTURE0);
80688269
80698270 return; // true;
8271
+ }
8272
+
8273
+ /*boolean*/ public void BindPigmentTexture(cTexture tex, int resolution) throws Exception // INTERFACE
8274
+ {
8275
+ if (// DrawMode() != 0 || /*tex == null ||*/
8276
+ ambientOcclusion ) // || !textureon)
8277
+ {
8278
+ return; // false;
8279
+ }
8280
+
8281
+ if (tex == null)
8282
+ {
8283
+ BindTexture(null,false,resolution);
8284
+ return;
8285
+ }
8286
+
8287
+ String pigment = Object3D.GetPigment(tex);
8288
+
8289
+ usedtextures.put(pigment, pigment);
8290
+
8291
+ if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
8292
+ {
8293
+ // System.out.print("BIND +++++++++++++++ pigment = " + pigment);
8294
+ // System.out.println("; bump = " + bump);
8295
+ }
8296
+
8297
+ if (pigment.equals(""))
8298
+ {
8299
+ pigment = null;
8300
+ }
8301
+
8302
+ GetGL().glActiveTexture(GetGL().GL_TEXTURE0);
8303
+ BindTexture(pigment, false, resolution);
8304
+ }
8305
+
8306
+ /*boolean*/ public void BindBumpTexture(cTexture tex, int resolution) throws Exception // INTERFACE
8307
+ {
8308
+ if (// DrawMode() != 0 || /*tex == null ||*/
8309
+ ambientOcclusion ) // || !textureon)
8310
+ {
8311
+ return; // false;
8312
+ }
8313
+
8314
+ if (tex == null)
8315
+ {
8316
+ BindTexture(null,true,resolution);
8317
+ return;
8318
+ }
8319
+
8320
+ String bump = Object3D.GetBump(tex);
8321
+
8322
+ usedtextures.put(bump, bump);
8323
+
8324
+ if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
8325
+ {
8326
+ // System.out.print("BIND +++++++++++++++ pigment = " + pigment);
8327
+ // System.out.println("; bump = " + bump);
8328
+ }
8329
+
8330
+ if (bump.equals(""))
8331
+ {
8332
+ bump = null;
8333
+ }
8334
+
8335
+ GetGL().glActiveTexture(GetGL().GL_TEXTURE2);
8336
+ BindTexture(bump, true, resolution);
8337
+ GetGL().glActiveTexture(GetGL().GL_TEXTURE0);
80708338 }
80718339
80728340 java.util.HashSet<String> missingTextures = new java.util.HashSet<String>();
....@@ -9234,11 +9502,35 @@
92349502 jy8[3] = 0.5f;
92359503 }
92369504
9237
- float[] options1 = new float[]{1000, 0.00001f, 20, 0, 0}; // focus, aperture, Shadow blur, aniso, anisoV
9505
+ float[] options1 = new float[]{100, 0.00001f, 20, 0, 0}; // focus, aperture, Shadow blur, aniso, anisoV
92389506 float[] options2 = new float[]{0, 1, 0, 0}; // fog density, intensity, elevation
92399507 float[] options3 = new float[]{1, 1, 1, 0}; // fog color
92409508 float[] options4 = new float[]{1, 0, 1, 0}; // image intensity, subsurface, lightsheen
92419509
9510
+ void ResetOptions()
9511
+ {
9512
+ options1[0] = 100;
9513
+ options1[1] = 0.025f;
9514
+ options1[2] = 0.01f;
9515
+ options1[3] = 0;
9516
+ options1[4] = 0;
9517
+
9518
+ options2[0] = 0;
9519
+ options2[1] = 0.75f;
9520
+ options2[2] = 0;
9521
+ options2[3] = 0;
9522
+
9523
+ options3[0] = 1;
9524
+ options3[1] = 1;
9525
+ options3[2] = 1;
9526
+ options3[3] = 0;
9527
+
9528
+ options4[0] = 1;
9529
+ options4[1] = 0;
9530
+ options4[2] = 1;
9531
+ options4[3] = 0;
9532
+ }
9533
+
92429534 static int imagecount = 0; // movie generation
92439535
92449536 static int jitter = 0;
....@@ -10349,6 +10641,7 @@
1034910641 ANTIALIAS = 0;
1035010642 //System.out.println("RESTART");
1035110643 AAtimer.restart();
10644
+ Globals.TIMERRUNNING = true;
1035210645 }
1035310646 }
1035410647 }
....@@ -10416,7 +10709,8 @@
1041610709 ambientOcclusion = false;
1041710710 }
1041810711
10419
- if (Globals.lighttouched && DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN)
10712
+ if (//Globals.lighttouched &&
10713
+ DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN)
1042010714 {
1042110715 //if (RENDERSHADOW) // ?
1042210716 if (!IsFrozen())
....@@ -11326,8 +11620,29 @@
1132611620
1132711621 static boolean zoomonce = false;
1132811622
11623
+ static void CreateSelectedPoint()
11624
+ {
11625
+ if (selectedpoint == null)
11626
+ {
11627
+ debugpointG = new Sphere();
11628
+ debugpointP = new Sphere();
11629
+ debugpointC = new Sphere();
11630
+ debugpointR = new Sphere();
11631
+
11632
+ selectedpoint = new Superellipsoid();
11633
+
11634
+ for (int i=0; i<8; i++)
11635
+ {
11636
+ debugpoints[i] = new Sphere();
11637
+ }
11638
+ }
11639
+ }
11640
+
1132911641 void DrawObject(GL gl, boolean draw)
1133011642 {
11643
+ // To clear camera values
11644
+ ResetOptions();
11645
+
1133111646 //System.out.println("DRAW OBJECT " + mouseDown);
1133211647 // DrawMode() = SELECTION;
1133311648 //GL gl = getGL();
....@@ -11406,8 +11721,9 @@
1140611721
1140711722 if (DrawMode() == DEFAULT)
1140811723 {
11409
- if (DEBUG)
11724
+ if (Globals.DEBUG)
1141011725 {
11726
+ CreateSelectedPoint();
1141111727 float radius = 0.05f;
1141211728 if (selectedpoint.radius != radius)
1141311729 {
....@@ -11894,7 +12210,7 @@
1189412210 for (int i = tp.size(); --i >= 0;)
1189512211 {
1189612212 //for (int count = tp.get(i).GetTransformCount(); --count>=0;)
11897
- LA.xformPos(light, tp.get(i).GlobalTransform(), light);
12213
+ LA.xformPos(light, tp.get(i).GlobalTransformInv(), light);
1189812214 }
1189912215
1190012216
....@@ -13164,7 +13480,8 @@
1316413480 /*static*/ float[] modelParams5 = new float[]{0, 0, 0, 0}; // texture, opacity, fakedepth, shadowbias
1316513481 /*static*/ float[] modelParams6 = new float[]{0, 0, 0, 0}; // bump, noise, borderfade, fog punchthrough
1316613482 /*static*/ float[] modelParams7 = new float[]{0, 0, 0, 0}; // noise power, opacity power
13167
- Object3D.cVector2[] vector2buffer;
13483
+
13484
+ //Object3D.cVector2[] vector2buffer;
1316813485
1316913486 // IN : ndotl, ndoth, xxx, NdotL //, snininess, lightarea
1317013487 // OUT : diff, spec
....@@ -13180,9 +13497,10 @@
1318013497 "DP3 " + dest + ".z," + "normals," + "eye;" +
1318113498 "MAX " + dest + ".w," + dest + ".z," + "eps.x;" +
1318213499 //"MOV " + dest + ".w," + "normal.z;" +
13183
- "MUL " + dest + ".z," + "params2.w," + dest + ".x;" +
13184
- "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" +
13185
- //"MOV " + dest + ".z," + "params2.w;" +
13500
+// "MUL " + dest + ".z," + "params2.w," + dest + ".x;" + // PRETTY HEURISTIC FOR VELVET
13501
+// "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" +
13502
+
13503
+ "MOV " + dest + ".z," + "params2.w;" + // EXACT
1318613504 "POW " + dest + ".w," + dest + ".w," + dest + ".z;" +
1318713505 "RCP " + dest + ".w," + dest + ".w;" +
1318813506 //"RSQ " + dest + ".w," + dest + ".w;" +
....@@ -13687,6 +14005,7 @@
1368714005 else
1368814006 if (evt.getSource() == AAtimer)
1368914007 {
14008
+ Globals.TIMERRUNNING = false;
1369014009 if (mouseDown)
1369114010 {
1369214011 //new Exception().printStackTrace();
....@@ -13761,6 +14080,7 @@
1376114080 return;
1376214081
1376314082 AAtimer.restart(); //
14083
+ Globals.TIMERRUNNING = true;
1376414084
1376514085 // waslive = LIVE;
1376614086 // LIVE = false;
....@@ -14224,7 +14544,8 @@
1422414544 info.camera = renderCamera;
1422514545 info.x = x;
1422614546 info.y = y;
14227
- object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
14547
+ object.GetWindow().copy
14548
+ .doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
1422814549 } else
1422914550 {
1423014551 if (x < startX)
....@@ -14388,7 +14709,9 @@
1438814709 ci.camera = renderCamera;
1438914710 if (!isRenderer)
1439014711 {
14391
- if (object.editWindow.copy.doEditClick(ci, 0))
14712
+ //ObjEditor editWindow = object.editWindow;
14713
+ //Object3D copy = editWindow.copy;
14714
+ if (object.doEditClick(ci, 0))
1439214715 {
1439314716 setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
1439414717 } else
....@@ -14769,8 +15092,14 @@
1476915092 RevertCamera();
1477015093 repaint();
1477115094 break;
14772
- case 'L':
1477315095 case 'l':
15096
+ lightMode ^= true;
15097
+ Globals.lighttouched = true;
15098
+ manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;
15099
+ targetLookAt.set(manipCamera.lookAt);
15100
+ repaint();
15101
+ break;
15102
+ case 'L':
1477415103 if (lightMode)
1477515104 {
1477615105 lightMode = false;
....@@ -14913,20 +15242,18 @@
1491315242 case '_':
1491415243 kompactbit = 5;
1491515244 break;
14916
- case '+':
14917
- kompactbit = 6;
14918
- break;
15245
+// case '+':
15246
+// kompactbit = 6;
15247
+// break;
1491915248 case ' ':
14920
- lightMode ^= true;
14921
- Globals.lighttouched = true;
14922
- manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;
14923
- targetLookAt.set(manipCamera.lookAt);
15249
+ ObjEditor.theFrame.ToggleFullScreen();
1492415250 repaint();
1492515251 break;
1492615252 //case '`' :
1492715253 case ESC:
1492815254 RENDERPROGRAM += 1;
1492915255 RENDERPROGRAM %= 3;
15256
+
1493015257 repaint();
1493115258 break;
1493215259 case 'Z':
....@@ -14966,8 +15293,15 @@
1496615293 case DELETE:
1496715294 ClearSelection();
1496815295 break;
14969
- /*
1497015296 case '+':
15297
+
15298
+ //for (int i=0; i<0x7FFFFFFF; i++)
15299
+ {
15300
+ //String.format("%08X", i); // "7caca905"
15301
+ GetRemoteZip("https://archive3d.net/?a=download&do=get&id=", "7caca905", true, true);
15302
+ }
15303
+
15304
+ /*
1497115305 //fontsize += 1;
1497215306 bbzoom *= 2;
1497315307 repaint();
....@@ -15218,7 +15552,7 @@
1521815552 }
1521915553 */
1522015554
15221
- object.editWindow.EditSelection();
15555
+ object.editWindow.EditSelection(false);
1522215556 }
1522315557
1522415558 void SelectParent()
....@@ -16230,16 +16564,16 @@
1623016564 cStatic.objectstack[materialdepth++] = checker;
1623116565 //System.out.println("material " + material);
1623216566 //Applet3D.tracein(this, selected);
16233
- vector2buffer = checker.projectedVertices;
16567
+ //vector2buffer = checker.projectedVertices;
1623416568
1623516569 //checker.GetMaterial().Draw(this, false); // true);
16236
- DrawMaterial(checker.GetMaterial(), false); // true);
16570
+ DrawMaterial(checker.GetMaterial(), false, checker.projectedVertices); // true);
1623716571
1623816572 materialdepth -= 1;
1623916573 if (materialdepth > 0)
1624016574 {
16241
- vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
16242
- DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1]);
16575
+ //vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
16576
+ DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1], cStatic.objectstack[materialdepth - 1].projectedVertices);
1624316577 }
1624416578 //checker.GetMaterial().opacity = 1f;
1624516579 ////checker.GetMaterial().ambient = 1f;
....@@ -16463,6 +16797,8 @@
1646316797 // System.err.println("view = " + view[8] + " " + view[9] + " " + view[10] + " " + view[11]);
1646416798 // System.err.println("view = " + view[12] + " " + view[13] + " " + view[14] + " " + view[15]);
1646516799
16800
+ CreateSelectedPoint();
16801
+
1646616802 // Will fit the mesh !!!
1646716803 selectedpoint.toParent[0][0] = 0.0001;
1646816804 selectedpoint.toParent[1][1] = 0.0001;
....@@ -16577,6 +16913,11 @@
1657716913 //System.out.println("objects[color] = " + objects[color]);
1657816914 //objects[color].Select();
1657916915 indexcount = 0;
16916
+ ObjEditor window = object.GetWindow();
16917
+ if (window != null && deselect)
16918
+ {
16919
+ window.Select(null, deselect, true);
16920
+ }
1658016921 object.Select(color, deselect);
1658116922 }
1658216923
....@@ -17102,23 +17443,15 @@
1710217443 int AAbuffersize = 0;
1710317444
1710417445 //double[] selectedpoint = new double[3];
17105
- static Superellipsoid selectedpoint = new Superellipsoid();
17446
+ static Superellipsoid selectedpoint;
1710617447 static Sphere previousselectedpoint = null;
17107
- static Sphere debugpointG = new Sphere();
17108
- static Sphere debugpointP = new Sphere();
17109
- static Sphere debugpointC = new Sphere();
17110
- static Sphere debugpointR = new Sphere();
17448
+ static Sphere debugpointG;
17449
+ static Sphere debugpointP;
17450
+ static Sphere debugpointC;
17451
+ static Sphere debugpointR;
1711117452
1711217453 static Sphere debugpoints[] = new Sphere[8];
1711317454
17114
- static
17115
- {
17116
- for (int i=0; i<8; i++)
17117
- {
17118
- debugpoints[i] = new Sphere();
17119
- }
17120
- }
17121
-
1712217455 static void InitPoints(float radius)
1712317456 {
1712417457 for (int i=0; i<8; i++)