.. | .. |
---|
335 | 335 | display.options1[2] = material.shadowbias; |
---|
336 | 336 | display.options1[3] = material.aniso; |
---|
337 | 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]); |
---|
338 | 343 | display.options2[0] = material.opacity; |
---|
339 | 344 | display.options2[1] = material.diffuse; |
---|
340 | 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]); |
---|
341 | 349 | |
---|
342 | 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]); |
---|
343 | 354 | display.options4[0] = material.cameralight/0.2f; |
---|
344 | 355 | display.options4[1] = material.subsurface; |
---|
345 | 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]); |
---|
346 | 360 | |
---|
347 | 361 | // if (display.CURRENTANTIALIAS > 0) |
---|
348 | 362 | // display.options3[3] /= 4; |
---|
.. | .. |
---|
2382 | 2396 | public GL GetGL() // INTERFACE |
---|
2383 | 2397 | { |
---|
2384 | 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 | + |
---|
2385 | 2521 | } |
---|
2386 | 2522 | |
---|
2387 | 2523 | /**/ |
---|
.. | .. |
---|
9374 | 9510 | void ResetOptions() |
---|
9375 | 9511 | { |
---|
9376 | 9512 | options1[0] = 100; |
---|
9377 | | - options1[1] = 0.00001f; |
---|
9378 | | - options1[2] = 20; |
---|
| 9513 | + options1[1] = 0.025f; |
---|
| 9514 | + options1[2] = 0.01f; |
---|
9379 | 9515 | options1[3] = 0; |
---|
9380 | 9516 | options1[4] = 0; |
---|
9381 | 9517 | |
---|
9382 | 9518 | options2[0] = 0; |
---|
9383 | | - options2[1] = 1; |
---|
| 9519 | + options2[1] = 0.75f; |
---|
9384 | 9520 | options2[2] = 0; |
---|
9385 | 9521 | options2[3] = 0; |
---|
9386 | 9522 | |
---|
.. | .. |
---|
13361 | 13497 | "DP3 " + dest + ".z," + "normals," + "eye;" + |
---|
13362 | 13498 | "MAX " + dest + ".w," + dest + ".z," + "eps.x;" + |
---|
13363 | 13499 | //"MOV " + dest + ".w," + "normal.z;" + |
---|
13364 | | - "MUL " + dest + ".z," + "params2.w," + dest + ".x;" + |
---|
13365 | | - "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" + |
---|
13366 | | - //"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 |
---|
13367 | 13504 | "POW " + dest + ".w," + dest + ".w," + dest + ".z;" + |
---|
13368 | 13505 | "RCP " + dest + ".w," + dest + ".w;" + |
---|
13369 | 13506 | //"RSQ " + dest + ".w," + dest + ".w;" + |
---|
.. | .. |
---|
15105 | 15242 | case '_': |
---|
15106 | 15243 | kompactbit = 5; |
---|
15107 | 15244 | break; |
---|
15108 | | - case '+': |
---|
15109 | | - kompactbit = 6; |
---|
15110 | | - break; |
---|
| 15245 | +// case '+': |
---|
| 15246 | +// kompactbit = 6; |
---|
| 15247 | +// break; |
---|
15111 | 15248 | case ' ': |
---|
15112 | 15249 | ObjEditor.theFrame.ToggleFullScreen(); |
---|
15113 | 15250 | repaint(); |
---|
.. | .. |
---|
15156 | 15293 | case DELETE: |
---|
15157 | 15294 | ClearSelection(); |
---|
15158 | 15295 | break; |
---|
15159 | | - /* |
---|
15160 | 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 | + /* |
---|
15161 | 15305 | //fontsize += 1; |
---|
15162 | 15306 | bbzoom *= 2; |
---|
15163 | 15307 | repaint(); |
---|
.. | .. |
---|
16769 | 16913 | //System.out.println("objects[color] = " + objects[color]); |
---|
16770 | 16914 | //objects[color].Select(); |
---|
16771 | 16915 | indexcount = 0; |
---|
| 16916 | + ObjEditor window = object.GetWindow(); |
---|
| 16917 | + if (window != null && deselect) |
---|
| 16918 | + { |
---|
| 16919 | + window.Select(null, deselect, true); |
---|
| 16920 | + } |
---|
16772 | 16921 | object.Select(color, deselect); |
---|
16773 | 16922 | } |
---|
16774 | 16923 | |
---|