.. | .. |
---|
326 | 326 | cStatic.objectstack[materialdepth++] = obj; |
---|
327 | 327 | //System.out.println("material " + material); |
---|
328 | 328 | //Applet3D.tracein(this, selected); |
---|
329 | | - display.vector2buffer = obj.projectedVertices; |
---|
| 329 | + //display.vector2buffer = obj.projectedVertices; |
---|
330 | 330 | if (obj instanceof Camera) |
---|
331 | 331 | { |
---|
332 | 332 | display.options1[0] = material.shift; |
---|
.. | .. |
---|
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; |
---|
.. | .. |
---|
358 | 372 | /**/ |
---|
359 | 373 | } else |
---|
360 | 374 | { |
---|
361 | | - DrawMaterial(material, selected); |
---|
| 375 | + DrawMaterial(material, selected, obj.projectedVertices); |
---|
362 | 376 | } |
---|
363 | 377 | } else |
---|
364 | 378 | { |
---|
.. | .. |
---|
382 | 396 | cStatic.objectstack[materialdepth++] = obj; |
---|
383 | 397 | //System.out.println("material " + material); |
---|
384 | 398 | //Applet3D.tracein("selected ", selected); |
---|
385 | | - display.vector2buffer = obj.projectedVertices; |
---|
386 | | - display.DrawMaterial(material, selected); |
---|
| 399 | + //display.vector2buffer = obj.projectedVertices; |
---|
| 400 | + display.DrawMaterial(material, selected, obj.projectedVertices); |
---|
387 | 401 | } |
---|
388 | 402 | } |
---|
389 | 403 | |
---|
.. | .. |
---|
400 | 414 | materialdepth -= 1; |
---|
401 | 415 | if (materialdepth > 0) |
---|
402 | 416 | { |
---|
403 | | - display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
404 | | - 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); |
---|
405 | 419 | } |
---|
406 | 420 | //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???"); |
---|
407 | 421 | } else if (selected && CameraPane.flash && obj.GetMaterial() != null) |
---|
.. | .. |
---|
421 | 435 | materialdepth -= 1; |
---|
422 | 436 | if (materialdepth > 0) |
---|
423 | 437 | { |
---|
424 | | - display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
425 | | - 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); |
---|
426 | 440 | } |
---|
427 | 441 | //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???"); |
---|
428 | 442 | //else |
---|
.. | .. |
---|
1610 | 1624 | // gl.glMaterialfv(gl.GL_BACK, gl.GL_DIFFUSE, colorV, 0); |
---|
1611 | 1625 | } |
---|
1612 | 1626 | |
---|
1613 | | - void DrawMaterial(cMaterial material, boolean selected) |
---|
| 1627 | + void DrawMaterial(cMaterial material, boolean selected, Object3D.cVector2[] others) |
---|
1614 | 1628 | { |
---|
1615 | 1629 | CameraPane display = this; |
---|
1616 | 1630 | //new Exception().printStackTrace(); |
---|
.. | .. |
---|
1645 | 1659 | colorV[0] = display.modelParams0[0] * material.diffuse; |
---|
1646 | 1660 | colorV[1] = display.modelParams0[1] * material.diffuse; |
---|
1647 | 1661 | colorV[2] = display.modelParams0[2] * material.diffuse; |
---|
1648 | | - colorV[3] = material.opacity; |
---|
| 1662 | + colorV[3] = 1; // material.opacity; |
---|
1649 | 1663 | |
---|
1650 | 1664 | gl.glColor4f(colorV[0], colorV[1], colorV[2], material.opacity); |
---|
1651 | 1665 | //System.out.println("Opacity = " + opacity); |
---|
.. | .. |
---|
1753 | 1767 | display.modelParams7[2] = 0; |
---|
1754 | 1768 | display.modelParams7[3] = 0; |
---|
1755 | 1769 | |
---|
1756 | | - display.modelParams6[0] = 100; // criss de bug de bump |
---|
| 1770 | + //display.modelParams6[0] = 100; // criss de bug de bump |
---|
1757 | 1771 | |
---|
1758 | | - Object3D.cVector2[] extparams = display.vector2buffer; |
---|
| 1772 | + Object3D.cVector2[] extparams = others; // display.vector2buffer; |
---|
1759 | 1773 | if (extparams != null && extparams.length > 0 && extparams[0] != null) |
---|
1760 | 1774 | { |
---|
1761 | 1775 | display.modelParams6[0] = extparams[0].x / 1000.0f; // bump |
---|
.. | .. |
---|
9366 | 9380 | jy8[3] = 0.5f; |
---|
9367 | 9381 | } |
---|
9368 | 9382 | |
---|
9369 | | - float[] options1 = new float[]{1000, 0.00001f, 20, 0, 0}; // focus, aperture, Shadow blur, aniso, anisoV |
---|
| 9383 | + float[] options1 = new float[]{100, 0.00001f, 20, 0, 0}; // focus, aperture, Shadow blur, aniso, anisoV |
---|
9370 | 9384 | float[] options2 = new float[]{0, 1, 0, 0}; // fog density, intensity, elevation |
---|
9371 | 9385 | float[] options3 = new float[]{1, 1, 1, 0}; // fog color |
---|
9372 | 9386 | float[] options4 = new float[]{1, 0, 1, 0}; // image intensity, subsurface, lightsheen |
---|
9373 | 9387 | |
---|
| 9388 | + void ResetOptions() |
---|
| 9389 | + { |
---|
| 9390 | + options1[0] = 100; |
---|
| 9391 | + options1[1] = 0.025f; |
---|
| 9392 | + options1[2] = 0.01f; |
---|
| 9393 | + options1[3] = 0; |
---|
| 9394 | + options1[4] = 0; |
---|
| 9395 | + |
---|
| 9396 | + options2[0] = 0; |
---|
| 9397 | + options2[1] = 0.75f; |
---|
| 9398 | + options2[2] = 0; |
---|
| 9399 | + options2[3] = 0; |
---|
| 9400 | + |
---|
| 9401 | + options3[0] = 1; |
---|
| 9402 | + options3[1] = 1; |
---|
| 9403 | + options3[2] = 1; |
---|
| 9404 | + options3[3] = 0; |
---|
| 9405 | + |
---|
| 9406 | + options4[0] = 1; |
---|
| 9407 | + options4[1] = 0; |
---|
| 9408 | + options4[2] = 1; |
---|
| 9409 | + options4[3] = 0; |
---|
| 9410 | + } |
---|
| 9411 | + |
---|
9374 | 9412 | static int imagecount = 0; // movie generation |
---|
9375 | 9413 | |
---|
9376 | 9414 | static int jitter = 0; |
---|
.. | .. |
---|
10481 | 10519 | ANTIALIAS = 0; |
---|
10482 | 10520 | //System.out.println("RESTART"); |
---|
10483 | 10521 | AAtimer.restart(); |
---|
| 10522 | + Globals.TIMERRUNNING = true; |
---|
10484 | 10523 | } |
---|
10485 | 10524 | } |
---|
10486 | 10525 | } |
---|
.. | .. |
---|
10548 | 10587 | ambientOcclusion = false; |
---|
10549 | 10588 | } |
---|
10550 | 10589 | |
---|
10551 | | - if (Globals.lighttouched && DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN) |
---|
| 10590 | + if (//Globals.lighttouched && |
---|
| 10591 | + DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN) |
---|
10552 | 10592 | { |
---|
10553 | 10593 | //if (RENDERSHADOW) // ? |
---|
10554 | 10594 | if (!IsFrozen()) |
---|
.. | .. |
---|
11458 | 11498 | |
---|
11459 | 11499 | static boolean zoomonce = false; |
---|
11460 | 11500 | |
---|
11461 | | - void CreateSelectedPoint() |
---|
| 11501 | + static void CreateSelectedPoint() |
---|
11462 | 11502 | { |
---|
11463 | 11503 | if (selectedpoint == null) |
---|
11464 | 11504 | { |
---|
.. | .. |
---|
11478 | 11518 | |
---|
11479 | 11519 | void DrawObject(GL gl, boolean draw) |
---|
11480 | 11520 | { |
---|
| 11521 | + // To clear camera values |
---|
| 11522 | + ResetOptions(); |
---|
| 11523 | + |
---|
11481 | 11524 | //System.out.println("DRAW OBJECT " + mouseDown); |
---|
11482 | 11525 | // DrawMode() = SELECTION; |
---|
11483 | 11526 | //GL gl = getGL(); |
---|
.. | .. |
---|
12045 | 12088 | for (int i = tp.size(); --i >= 0;) |
---|
12046 | 12089 | { |
---|
12047 | 12090 | //for (int count = tp.get(i).GetTransformCount(); --count>=0;) |
---|
12048 | | - LA.xformPos(light, tp.get(i).GlobalTransform(), light); |
---|
| 12091 | + LA.xformPos(light, tp.get(i).GlobalTransformInv(), light); |
---|
12049 | 12092 | } |
---|
12050 | 12093 | |
---|
12051 | 12094 | |
---|
.. | .. |
---|
13315 | 13358 | /*static*/ float[] modelParams5 = new float[]{0, 0, 0, 0}; // texture, opacity, fakedepth, shadowbias |
---|
13316 | 13359 | /*static*/ float[] modelParams6 = new float[]{0, 0, 0, 0}; // bump, noise, borderfade, fog punchthrough |
---|
13317 | 13360 | /*static*/ float[] modelParams7 = new float[]{0, 0, 0, 0}; // noise power, opacity power |
---|
13318 | | - Object3D.cVector2[] vector2buffer; |
---|
| 13361 | + |
---|
| 13362 | + //Object3D.cVector2[] vector2buffer; |
---|
13319 | 13363 | |
---|
13320 | 13364 | // IN : ndotl, ndoth, xxx, NdotL //, snininess, lightarea |
---|
13321 | 13365 | // OUT : diff, spec |
---|
.. | .. |
---|
13838 | 13882 | else |
---|
13839 | 13883 | if (evt.getSource() == AAtimer) |
---|
13840 | 13884 | { |
---|
| 13885 | + Globals.TIMERRUNNING = false; |
---|
13841 | 13886 | if (mouseDown) |
---|
13842 | 13887 | { |
---|
13843 | 13888 | //new Exception().printStackTrace(); |
---|
.. | .. |
---|
13912 | 13957 | return; |
---|
13913 | 13958 | |
---|
13914 | 13959 | AAtimer.restart(); // |
---|
| 13960 | + Globals.TIMERRUNNING = true; |
---|
13915 | 13961 | |
---|
13916 | 13962 | // waslive = LIVE; |
---|
13917 | 13963 | // LIVE = false; |
---|
.. | .. |
---|
14375 | 14421 | info.camera = renderCamera; |
---|
14376 | 14422 | info.x = x; |
---|
14377 | 14423 | info.y = y; |
---|
14378 | | - object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
| 14424 | + object.GetWindow().copy |
---|
| 14425 | + .doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
14379 | 14426 | } else |
---|
14380 | 14427 | { |
---|
14381 | 14428 | if (x < startX) |
---|
.. | .. |
---|
14539 | 14586 | ci.camera = renderCamera; |
---|
14540 | 14587 | if (!isRenderer) |
---|
14541 | 14588 | { |
---|
14542 | | - if (object.editWindow.copy.doEditClick(ci, 0)) |
---|
| 14589 | + //ObjEditor editWindow = object.editWindow; |
---|
| 14590 | + //Object3D copy = editWindow.copy; |
---|
| 14591 | + if (object.doEditClick(ci, 0)) |
---|
14543 | 14592 | { |
---|
14544 | 14593 | setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); |
---|
14545 | 14594 | } else |
---|
.. | .. |
---|
15373 | 15422 | } |
---|
15374 | 15423 | */ |
---|
15375 | 15424 | |
---|
15376 | | - object.editWindow.EditSelection(); |
---|
| 15425 | + object.editWindow.EditSelection(false); |
---|
15377 | 15426 | } |
---|
15378 | 15427 | |
---|
15379 | 15428 | void SelectParent() |
---|
.. | .. |
---|
16385 | 16434 | cStatic.objectstack[materialdepth++] = checker; |
---|
16386 | 16435 | //System.out.println("material " + material); |
---|
16387 | 16436 | //Applet3D.tracein(this, selected); |
---|
16388 | | - vector2buffer = checker.projectedVertices; |
---|
| 16437 | + //vector2buffer = checker.projectedVertices; |
---|
16389 | 16438 | |
---|
16390 | 16439 | //checker.GetMaterial().Draw(this, false); // true); |
---|
16391 | | - DrawMaterial(checker.GetMaterial(), false); // true); |
---|
| 16440 | + DrawMaterial(checker.GetMaterial(), false, checker.projectedVertices); // true); |
---|
16392 | 16441 | |
---|
16393 | 16442 | materialdepth -= 1; |
---|
16394 | 16443 | if (materialdepth > 0) |
---|
16395 | 16444 | { |
---|
16396 | | - vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
16397 | | - DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1]); |
---|
| 16445 | + //vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
| 16446 | + DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1], cStatic.objectstack[materialdepth - 1].projectedVertices); |
---|
16398 | 16447 | } |
---|
16399 | 16448 | //checker.GetMaterial().opacity = 1f; |
---|
16400 | 16449 | ////checker.GetMaterial().ambient = 1f; |
---|
.. | .. |
---|
16618 | 16667 | // System.err.println("view = " + view[8] + " " + view[9] + " " + view[10] + " " + view[11]); |
---|
16619 | 16668 | // System.err.println("view = " + view[12] + " " + view[13] + " " + view[14] + " " + view[15]); |
---|
16620 | 16669 | |
---|
| 16670 | + CreateSelectedPoint(); |
---|
| 16671 | + |
---|
16621 | 16672 | // Will fit the mesh !!! |
---|
16622 | 16673 | selectedpoint.toParent[0][0] = 0.0001; |
---|
16623 | 16674 | selectedpoint.toParent[1][1] = 0.0001; |
---|
.. | .. |
---|
16732 | 16783 | //System.out.println("objects[color] = " + objects[color]); |
---|
16733 | 16784 | //objects[color].Select(); |
---|
16734 | 16785 | indexcount = 0; |
---|
| 16786 | + ObjEditor window = object.GetWindow(); |
---|
| 16787 | + if (window != null && deselect) |
---|
| 16788 | + { |
---|
| 16789 | + window.Select(null, deselect, true); |
---|
| 16790 | + } |
---|
16735 | 16791 | object.Select(color, deselect); |
---|
16736 | 16792 | } |
---|
16737 | 16793 | |
---|