.. | .. |
---|
37 | 37 | static boolean[] selectedstack = new boolean[65536]; |
---|
38 | 38 | static int materialdepth = 0; |
---|
39 | 39 | |
---|
40 | | - static boolean DEBUG = false; |
---|
41 | 40 | static boolean FRUSTUM = false; // still bogus true; // frustum culling |
---|
42 | 41 | |
---|
43 | 42 | // camera change fix |
---|
.. | .. |
---|
327 | 326 | cStatic.objectstack[materialdepth++] = obj; |
---|
328 | 327 | //System.out.println("material " + material); |
---|
329 | 328 | //Applet3D.tracein(this, selected); |
---|
330 | | - display.vector2buffer = obj.projectedVertices; |
---|
| 329 | + //display.vector2buffer = obj.projectedVertices; |
---|
331 | 330 | if (obj instanceof Camera) |
---|
332 | 331 | { |
---|
333 | 332 | display.options1[0] = material.shift; |
---|
.. | .. |
---|
336 | 335 | display.options1[2] = material.shadowbias; |
---|
337 | 336 | display.options1[3] = material.aniso; |
---|
338 | 337 | 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]); |
---|
339 | 343 | display.options2[0] = material.opacity; |
---|
340 | 344 | display.options2[1] = material.diffuse; |
---|
341 | 345 | 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]); |
---|
342 | 349 | |
---|
343 | 350 | 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]); |
---|
344 | 354 | display.options4[0] = material.cameralight/0.2f; |
---|
345 | 355 | display.options4[1] = material.subsurface; |
---|
346 | 356 | 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]); |
---|
347 | 360 | |
---|
348 | 361 | // if (display.CURRENTANTIALIAS > 0) |
---|
349 | 362 | // display.options3[3] /= 4; |
---|
.. | .. |
---|
359 | 372 | /**/ |
---|
360 | 373 | } else |
---|
361 | 374 | { |
---|
362 | | - DrawMaterial(material, selected); |
---|
| 375 | + DrawMaterial(material, selected, obj.projectedVertices); |
---|
363 | 376 | } |
---|
364 | 377 | } else |
---|
365 | 378 | { |
---|
.. | .. |
---|
383 | 396 | cStatic.objectstack[materialdepth++] = obj; |
---|
384 | 397 | //System.out.println("material " + material); |
---|
385 | 398 | //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); |
---|
388 | 401 | } |
---|
389 | 402 | } |
---|
390 | 403 | |
---|
.. | .. |
---|
401 | 414 | materialdepth -= 1; |
---|
402 | 415 | if (materialdepth > 0) |
---|
403 | 416 | { |
---|
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); |
---|
406 | 419 | } |
---|
407 | 420 | //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???"); |
---|
408 | 421 | } else if (selected && CameraPane.flash && obj.GetMaterial() != null) |
---|
.. | .. |
---|
422 | 435 | materialdepth -= 1; |
---|
423 | 436 | if (materialdepth > 0) |
---|
424 | 437 | { |
---|
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); |
---|
427 | 440 | } |
---|
428 | 441 | //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???"); |
---|
429 | 442 | //else |
---|
.. | .. |
---|
464 | 477 | if (!selectmode) // display.drawMode != display.SELECTION) // && display.drawMode != display.SHADOW) // (attributes & FILL) != 0) |
---|
465 | 478 | { |
---|
466 | 479 | //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 | + ; |
---|
468 | 483 | if (!hasnorm) |
---|
469 | 484 | { |
---|
470 | | - // System.out.println("FUCK!!"); |
---|
| 485 | + // System.out.println("Mesh normal"); |
---|
471 | 486 | LA.vecSub(pv/*.pos*/, qv/*.pos*/, obj.v0); |
---|
472 | 487 | LA.vecSub(pv/*.pos*/, rv/*.pos*/, obj.v1); |
---|
473 | 488 | LA.vecCross(obj.v0, obj.v1, obj.v2); |
---|
.. | .. |
---|
1192 | 1207 | gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1); |
---|
1193 | 1208 | } |
---|
1194 | 1209 | } |
---|
| 1210 | + |
---|
1195 | 1211 | if (flipV) |
---|
1196 | 1212 | gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]); |
---|
1197 | 1213 | else |
---|
1198 | 1214 | gl.glTexCoord2f(uv[count2], uv[count2 + 1]); |
---|
| 1215 | + |
---|
1199 | 1216 | //System.out.println("vertex1 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]); |
---|
1200 | 1217 | gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]); |
---|
1201 | 1218 | |
---|
.. | .. |
---|
1215 | 1232 | gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1); |
---|
1216 | 1233 | } |
---|
1217 | 1234 | } |
---|
| 1235 | + |
---|
1218 | 1236 | if (flipV) |
---|
1219 | 1237 | gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]); |
---|
1220 | 1238 | else |
---|
1221 | 1239 | gl.glTexCoord2f(uv[count2], uv[count2 + 1]); |
---|
| 1240 | + |
---|
1222 | 1241 | //System.out.println("vertex2 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]); |
---|
1223 | 1242 | gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]); |
---|
1224 | 1243 | |
---|
.. | .. |
---|
1246 | 1265 | gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]); |
---|
1247 | 1266 | else |
---|
1248 | 1267 | gl.glTexCoord2f(uv[count2], uv[count2 + 1]); |
---|
| 1268 | + |
---|
1249 | 1269 | //System.out.println("coord3 = " + uv[count2] + ", " + uv[count2+1]); |
---|
1250 | 1270 | gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]); |
---|
| 1271 | + |
---|
1251 | 1272 | count2 += 2; |
---|
1252 | 1273 | count3 += 3; |
---|
1253 | 1274 | } |
---|
.. | .. |
---|
1603 | 1624 | // gl.glMaterialfv(gl.GL_BACK, gl.GL_DIFFUSE, colorV, 0); |
---|
1604 | 1625 | } |
---|
1605 | 1626 | |
---|
1606 | | - void DrawMaterial(cMaterial material, boolean selected) |
---|
| 1627 | + void DrawMaterial(cMaterial material, boolean selected, Object3D.cVector2[] others) |
---|
1607 | 1628 | { |
---|
1608 | 1629 | CameraPane display = this; |
---|
1609 | 1630 | //new Exception().printStackTrace(); |
---|
.. | .. |
---|
1638 | 1659 | colorV[0] = display.modelParams0[0] * material.diffuse; |
---|
1639 | 1660 | colorV[1] = display.modelParams0[1] * material.diffuse; |
---|
1640 | 1661 | colorV[2] = display.modelParams0[2] * material.diffuse; |
---|
1641 | | - colorV[3] = material.opacity; |
---|
| 1662 | + colorV[3] = 1; // material.opacity; |
---|
1642 | 1663 | |
---|
1643 | 1664 | gl.glColor4f(colorV[0], colorV[1], colorV[2], material.opacity); |
---|
1644 | 1665 | //System.out.println("Opacity = " + opacity); |
---|
.. | .. |
---|
1746 | 1767 | display.modelParams7[2] = 0; |
---|
1747 | 1768 | display.modelParams7[3] = 0; |
---|
1748 | 1769 | |
---|
1749 | | - display.modelParams6[0] = 100; // criss de bug de bump |
---|
| 1770 | + //display.modelParams6[0] = 100; // criss de bug de bump |
---|
1750 | 1771 | |
---|
1751 | | - Object3D.cVector2[] extparams = display.vector2buffer; |
---|
| 1772 | + Object3D.cVector2[] extparams = others; // display.vector2buffer; |
---|
1752 | 1773 | if (extparams != null && extparams.length > 0 && extparams[0] != null) |
---|
1753 | 1774 | { |
---|
1754 | 1775 | display.modelParams6[0] = extparams[0].x / 1000.0f; // bump |
---|
.. | .. |
---|
2259 | 2280 | |
---|
2260 | 2281 | void ToggleDebug() |
---|
2261 | 2282 | { |
---|
2262 | | - DEBUG ^= true; |
---|
| 2283 | + Globals.DEBUG ^= true; |
---|
2263 | 2284 | } |
---|
2264 | 2285 | |
---|
2265 | 2286 | void ToggleLookAt() |
---|
.. | .. |
---|
2375 | 2396 | public GL GetGL() // INTERFACE |
---|
2376 | 2397 | { |
---|
2377 | 2398 | 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 | + |
---|
2378 | 2521 | } |
---|
2379 | 2522 | |
---|
2380 | 2523 | /**/ |
---|
.. | .. |
---|
9359 | 9502 | jy8[3] = 0.5f; |
---|
9360 | 9503 | } |
---|
9361 | 9504 | |
---|
9362 | | - 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 |
---|
9363 | 9506 | float[] options2 = new float[]{0, 1, 0, 0}; // fog density, intensity, elevation |
---|
9364 | 9507 | float[] options3 = new float[]{1, 1, 1, 0}; // fog color |
---|
9365 | 9508 | float[] options4 = new float[]{1, 0, 1, 0}; // image intensity, subsurface, lightsheen |
---|
9366 | 9509 | |
---|
| 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 | + |
---|
9367 | 9534 | static int imagecount = 0; // movie generation |
---|
9368 | 9535 | |
---|
9369 | 9536 | static int jitter = 0; |
---|
.. | .. |
---|
10474 | 10641 | ANTIALIAS = 0; |
---|
10475 | 10642 | //System.out.println("RESTART"); |
---|
10476 | 10643 | AAtimer.restart(); |
---|
| 10644 | + Globals.TIMERRUNNING = true; |
---|
10477 | 10645 | } |
---|
10478 | 10646 | } |
---|
10479 | 10647 | } |
---|
.. | .. |
---|
10541 | 10709 | ambientOcclusion = false; |
---|
10542 | 10710 | } |
---|
10543 | 10711 | |
---|
10544 | | - if (Globals.lighttouched && DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN) |
---|
| 10712 | + if (//Globals.lighttouched && |
---|
| 10713 | + DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN) |
---|
10545 | 10714 | { |
---|
10546 | 10715 | //if (RENDERSHADOW) // ? |
---|
10547 | 10716 | if (!IsFrozen()) |
---|
.. | .. |
---|
11451 | 11620 | |
---|
11452 | 11621 | static boolean zoomonce = false; |
---|
11453 | 11622 | |
---|
| 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 | + |
---|
11454 | 11641 | void DrawObject(GL gl, boolean draw) |
---|
11455 | 11642 | { |
---|
| 11643 | + // To clear camera values |
---|
| 11644 | + ResetOptions(); |
---|
| 11645 | + |
---|
11456 | 11646 | //System.out.println("DRAW OBJECT " + mouseDown); |
---|
11457 | 11647 | // DrawMode() = SELECTION; |
---|
11458 | 11648 | //GL gl = getGL(); |
---|
.. | .. |
---|
11531 | 11721 | |
---|
11532 | 11722 | if (DrawMode() == DEFAULT) |
---|
11533 | 11723 | { |
---|
11534 | | - if (DEBUG) |
---|
| 11724 | + if (Globals.DEBUG) |
---|
11535 | 11725 | { |
---|
| 11726 | + CreateSelectedPoint(); |
---|
11536 | 11727 | float radius = 0.05f; |
---|
11537 | 11728 | if (selectedpoint.radius != radius) |
---|
11538 | 11729 | { |
---|
.. | .. |
---|
12019 | 12210 | for (int i = tp.size(); --i >= 0;) |
---|
12020 | 12211 | { |
---|
12021 | 12212 | //for (int count = tp.get(i).GetTransformCount(); --count>=0;) |
---|
12022 | | - LA.xformPos(light, tp.get(i).GlobalTransform(), light); |
---|
| 12213 | + LA.xformPos(light, tp.get(i).GlobalTransformInv(), light); |
---|
12023 | 12214 | } |
---|
12024 | 12215 | |
---|
12025 | 12216 | |
---|
.. | .. |
---|
13289 | 13480 | /*static*/ float[] modelParams5 = new float[]{0, 0, 0, 0}; // texture, opacity, fakedepth, shadowbias |
---|
13290 | 13481 | /*static*/ float[] modelParams6 = new float[]{0, 0, 0, 0}; // bump, noise, borderfade, fog punchthrough |
---|
13291 | 13482 | /*static*/ float[] modelParams7 = new float[]{0, 0, 0, 0}; // noise power, opacity power |
---|
13292 | | - Object3D.cVector2[] vector2buffer; |
---|
| 13483 | + |
---|
| 13484 | + //Object3D.cVector2[] vector2buffer; |
---|
13293 | 13485 | |
---|
13294 | 13486 | // IN : ndotl, ndoth, xxx, NdotL //, snininess, lightarea |
---|
13295 | 13487 | // OUT : diff, spec |
---|
.. | .. |
---|
13305 | 13497 | "DP3 " + dest + ".z," + "normals," + "eye;" + |
---|
13306 | 13498 | "MAX " + dest + ".w," + dest + ".z," + "eps.x;" + |
---|
13307 | 13499 | //"MOV " + dest + ".w," + "normal.z;" + |
---|
13308 | | - "MUL " + dest + ".z," + "params2.w," + dest + ".x;" + |
---|
13309 | | - "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" + |
---|
13310 | | - //"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 |
---|
13311 | 13504 | "POW " + dest + ".w," + dest + ".w," + dest + ".z;" + |
---|
13312 | 13505 | "RCP " + dest + ".w," + dest + ".w;" + |
---|
13313 | 13506 | //"RSQ " + dest + ".w," + dest + ".w;" + |
---|
.. | .. |
---|
13812 | 14005 | else |
---|
13813 | 14006 | if (evt.getSource() == AAtimer) |
---|
13814 | 14007 | { |
---|
| 14008 | + Globals.TIMERRUNNING = false; |
---|
13815 | 14009 | if (mouseDown) |
---|
13816 | 14010 | { |
---|
13817 | 14011 | //new Exception().printStackTrace(); |
---|
.. | .. |
---|
13886 | 14080 | return; |
---|
13887 | 14081 | |
---|
13888 | 14082 | AAtimer.restart(); // |
---|
| 14083 | + Globals.TIMERRUNNING = true; |
---|
13889 | 14084 | |
---|
13890 | 14085 | // waslive = LIVE; |
---|
13891 | 14086 | // LIVE = false; |
---|
.. | .. |
---|
14349 | 14544 | info.camera = renderCamera; |
---|
14350 | 14545 | info.x = x; |
---|
14351 | 14546 | info.y = y; |
---|
14352 | | - object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
| 14547 | + object.GetWindow().copy |
---|
| 14548 | + .doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
14353 | 14549 | } else |
---|
14354 | 14550 | { |
---|
14355 | 14551 | if (x < startX) |
---|
.. | .. |
---|
14513 | 14709 | ci.camera = renderCamera; |
---|
14514 | 14710 | if (!isRenderer) |
---|
14515 | 14711 | { |
---|
14516 | | - if (object.editWindow.copy.doEditClick(ci, 0)) |
---|
| 14712 | + //ObjEditor editWindow = object.editWindow; |
---|
| 14713 | + //Object3D copy = editWindow.copy; |
---|
| 14714 | + if (object.doEditClick(ci, 0)) |
---|
14517 | 14715 | { |
---|
14518 | 14716 | setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); |
---|
14519 | 14717 | } else |
---|
.. | .. |
---|
14894 | 15092 | RevertCamera(); |
---|
14895 | 15093 | repaint(); |
---|
14896 | 15094 | break; |
---|
14897 | | - case 'L': |
---|
14898 | 15095 | 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': |
---|
14899 | 15103 | if (lightMode) |
---|
14900 | 15104 | { |
---|
14901 | 15105 | lightMode = false; |
---|
.. | .. |
---|
15038 | 15242 | case '_': |
---|
15039 | 15243 | kompactbit = 5; |
---|
15040 | 15244 | break; |
---|
15041 | | - case '+': |
---|
15042 | | - kompactbit = 6; |
---|
15043 | | - break; |
---|
| 15245 | +// case '+': |
---|
| 15246 | +// kompactbit = 6; |
---|
| 15247 | +// break; |
---|
15044 | 15248 | case ' ': |
---|
15045 | | - lightMode ^= true; |
---|
15046 | | - Globals.lighttouched = true; |
---|
15047 | | - manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera; |
---|
15048 | | - targetLookAt.set(manipCamera.lookAt); |
---|
| 15249 | + ObjEditor.theFrame.ToggleFullScreen(); |
---|
15049 | 15250 | repaint(); |
---|
15050 | 15251 | break; |
---|
15051 | 15252 | //case '`' : |
---|
15052 | 15253 | case ESC: |
---|
15053 | 15254 | RENDERPROGRAM += 1; |
---|
15054 | 15255 | RENDERPROGRAM %= 3; |
---|
| 15256 | + |
---|
15055 | 15257 | repaint(); |
---|
15056 | 15258 | break; |
---|
15057 | 15259 | case 'Z': |
---|
.. | .. |
---|
15091 | 15293 | case DELETE: |
---|
15092 | 15294 | ClearSelection(); |
---|
15093 | 15295 | break; |
---|
15094 | | - /* |
---|
15095 | 15296 | 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 | + /* |
---|
15096 | 15305 | //fontsize += 1; |
---|
15097 | 15306 | bbzoom *= 2; |
---|
15098 | 15307 | repaint(); |
---|
.. | .. |
---|
15343 | 15552 | } |
---|
15344 | 15553 | */ |
---|
15345 | 15554 | |
---|
15346 | | - object.editWindow.EditSelection(); |
---|
| 15555 | + object.editWindow.EditSelection(false); |
---|
15347 | 15556 | } |
---|
15348 | 15557 | |
---|
15349 | 15558 | void SelectParent() |
---|
.. | .. |
---|
16355 | 16564 | cStatic.objectstack[materialdepth++] = checker; |
---|
16356 | 16565 | //System.out.println("material " + material); |
---|
16357 | 16566 | //Applet3D.tracein(this, selected); |
---|
16358 | | - vector2buffer = checker.projectedVertices; |
---|
| 16567 | + //vector2buffer = checker.projectedVertices; |
---|
16359 | 16568 | |
---|
16360 | 16569 | //checker.GetMaterial().Draw(this, false); // true); |
---|
16361 | | - DrawMaterial(checker.GetMaterial(), false); // true); |
---|
| 16570 | + DrawMaterial(checker.GetMaterial(), false, checker.projectedVertices); // true); |
---|
16362 | 16571 | |
---|
16363 | 16572 | materialdepth -= 1; |
---|
16364 | 16573 | if (materialdepth > 0) |
---|
16365 | 16574 | { |
---|
16366 | | - vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
16367 | | - 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); |
---|
16368 | 16577 | } |
---|
16369 | 16578 | //checker.GetMaterial().opacity = 1f; |
---|
16370 | 16579 | ////checker.GetMaterial().ambient = 1f; |
---|
.. | .. |
---|
16588 | 16797 | // System.err.println("view = " + view[8] + " " + view[9] + " " + view[10] + " " + view[11]); |
---|
16589 | 16798 | // System.err.println("view = " + view[12] + " " + view[13] + " " + view[14] + " " + view[15]); |
---|
16590 | 16799 | |
---|
| 16800 | + CreateSelectedPoint(); |
---|
| 16801 | + |
---|
16591 | 16802 | // Will fit the mesh !!! |
---|
16592 | 16803 | selectedpoint.toParent[0][0] = 0.0001; |
---|
16593 | 16804 | selectedpoint.toParent[1][1] = 0.0001; |
---|
.. | .. |
---|
16702 | 16913 | //System.out.println("objects[color] = " + objects[color]); |
---|
16703 | 16914 | //objects[color].Select(); |
---|
16704 | 16915 | indexcount = 0; |
---|
| 16916 | + ObjEditor window = object.GetWindow(); |
---|
| 16917 | + if (window != null && deselect) |
---|
| 16918 | + { |
---|
| 16919 | + window.Select(null, deselect, true); |
---|
| 16920 | + } |
---|
16705 | 16921 | object.Select(color, deselect); |
---|
16706 | 16922 | } |
---|
16707 | 16923 | |
---|
.. | .. |
---|
17227 | 17443 | int AAbuffersize = 0; |
---|
17228 | 17444 | |
---|
17229 | 17445 | //double[] selectedpoint = new double[3]; |
---|
17230 | | - static Superellipsoid selectedpoint = new Superellipsoid(); |
---|
| 17446 | + static Superellipsoid selectedpoint; |
---|
17231 | 17447 | 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(); |
---|
| 17448 | + static Sphere debugpointG; |
---|
| 17449 | + static Sphere debugpointP; |
---|
| 17450 | + static Sphere debugpointC; |
---|
| 17451 | + static Sphere debugpointR; |
---|
17236 | 17452 | |
---|
17237 | 17453 | static Sphere debugpoints[] = new Sphere[8]; |
---|
17238 | 17454 | |
---|
17239 | | - static |
---|
17240 | | - { |
---|
17241 | | - for (int i=0; i<8; i++) |
---|
17242 | | - { |
---|
17243 | | - debugpoints[i] = new Sphere(); |
---|
17244 | | - } |
---|
17245 | | - } |
---|
17246 | | - |
---|
17247 | 17455 | static void InitPoints(float radius) |
---|
17248 | 17456 | { |
---|
17249 | 17457 | for (int i=0; i<8; i++) |
---|