.. | .. |
---|
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; |
---|
.. | .. |
---|
358 | 358 | /**/ |
---|
359 | 359 | } else |
---|
360 | 360 | { |
---|
361 | | - DrawMaterial(material, selected); |
---|
| 361 | + DrawMaterial(material, selected, obj.projectedVertices); |
---|
362 | 362 | } |
---|
363 | 363 | } else |
---|
364 | 364 | { |
---|
.. | .. |
---|
382 | 382 | cStatic.objectstack[materialdepth++] = obj; |
---|
383 | 383 | //System.out.println("material " + material); |
---|
384 | 384 | //Applet3D.tracein("selected ", selected); |
---|
385 | | - display.vector2buffer = obj.projectedVertices; |
---|
386 | | - display.DrawMaterial(material, selected); |
---|
| 385 | + //display.vector2buffer = obj.projectedVertices; |
---|
| 386 | + display.DrawMaterial(material, selected, obj.projectedVertices); |
---|
387 | 387 | } |
---|
388 | 388 | } |
---|
389 | 389 | |
---|
.. | .. |
---|
400 | 400 | materialdepth -= 1; |
---|
401 | 401 | if (materialdepth > 0) |
---|
402 | 402 | { |
---|
403 | | - display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
404 | | - 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); |
---|
405 | 405 | } |
---|
406 | 406 | //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???"); |
---|
407 | 407 | } else if (selected && CameraPane.flash && obj.GetMaterial() != null) |
---|
.. | .. |
---|
421 | 421 | materialdepth -= 1; |
---|
422 | 422 | if (materialdepth > 0) |
---|
423 | 423 | { |
---|
424 | | - display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
425 | | - 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); |
---|
426 | 426 | } |
---|
427 | 427 | //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???"); |
---|
428 | 428 | //else |
---|
.. | .. |
---|
1610 | 1610 | // gl.glMaterialfv(gl.GL_BACK, gl.GL_DIFFUSE, colorV, 0); |
---|
1611 | 1611 | } |
---|
1612 | 1612 | |
---|
1613 | | - void DrawMaterial(cMaterial material, boolean selected) |
---|
| 1613 | + void DrawMaterial(cMaterial material, boolean selected, Object3D.cVector2[] others) |
---|
1614 | 1614 | { |
---|
1615 | 1615 | CameraPane display = this; |
---|
1616 | 1616 | //new Exception().printStackTrace(); |
---|
.. | .. |
---|
1645 | 1645 | colorV[0] = display.modelParams0[0] * material.diffuse; |
---|
1646 | 1646 | colorV[1] = display.modelParams0[1] * material.diffuse; |
---|
1647 | 1647 | colorV[2] = display.modelParams0[2] * material.diffuse; |
---|
1648 | | - colorV[3] = material.opacity; |
---|
| 1648 | + colorV[3] = 1; // material.opacity; |
---|
1649 | 1649 | |
---|
1650 | 1650 | gl.glColor4f(colorV[0], colorV[1], colorV[2], material.opacity); |
---|
1651 | 1651 | //System.out.println("Opacity = " + opacity); |
---|
.. | .. |
---|
1753 | 1753 | display.modelParams7[2] = 0; |
---|
1754 | 1754 | display.modelParams7[3] = 0; |
---|
1755 | 1755 | |
---|
1756 | | - display.modelParams6[0] = 100; // criss de bug de bump |
---|
| 1756 | + //display.modelParams6[0] = 100; // criss de bug de bump |
---|
1757 | 1757 | |
---|
1758 | | - Object3D.cVector2[] extparams = display.vector2buffer; |
---|
| 1758 | + Object3D.cVector2[] extparams = others; // display.vector2buffer; |
---|
1759 | 1759 | if (extparams != null && extparams.length > 0 && extparams[0] != null) |
---|
1760 | 1760 | { |
---|
1761 | 1761 | display.modelParams6[0] = extparams[0].x / 1000.0f; // bump |
---|
.. | .. |
---|
9366 | 9366 | jy8[3] = 0.5f; |
---|
9367 | 9367 | } |
---|
9368 | 9368 | |
---|
9369 | | - 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 |
---|
9370 | 9370 | float[] options2 = new float[]{0, 1, 0, 0}; // fog density, intensity, elevation |
---|
9371 | 9371 | float[] options3 = new float[]{1, 1, 1, 0}; // fog color |
---|
9372 | 9372 | float[] options4 = new float[]{1, 0, 1, 0}; // image intensity, subsurface, lightsheen |
---|
9373 | 9373 | |
---|
| 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 | + |
---|
9374 | 9398 | static int imagecount = 0; // movie generation |
---|
9375 | 9399 | |
---|
9376 | 9400 | static int jitter = 0; |
---|
.. | .. |
---|
10481 | 10505 | ANTIALIAS = 0; |
---|
10482 | 10506 | //System.out.println("RESTART"); |
---|
10483 | 10507 | AAtimer.restart(); |
---|
| 10508 | + Globals.TIMERRUNNING = true; |
---|
10484 | 10509 | } |
---|
10485 | 10510 | } |
---|
10486 | 10511 | } |
---|
.. | .. |
---|
10548 | 10573 | ambientOcclusion = false; |
---|
10549 | 10574 | } |
---|
10550 | 10575 | |
---|
10551 | | - if (Globals.lighttouched && DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN) |
---|
| 10576 | + if (//Globals.lighttouched && |
---|
| 10577 | + DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN) |
---|
10552 | 10578 | { |
---|
10553 | 10579 | //if (RENDERSHADOW) // ? |
---|
10554 | 10580 | if (!IsFrozen()) |
---|
.. | .. |
---|
11458 | 11484 | |
---|
11459 | 11485 | static boolean zoomonce = false; |
---|
11460 | 11486 | |
---|
11461 | | - void CreateSelectedPoint() |
---|
| 11487 | + static void CreateSelectedPoint() |
---|
11462 | 11488 | { |
---|
11463 | 11489 | if (selectedpoint == null) |
---|
11464 | 11490 | { |
---|
.. | .. |
---|
11478 | 11504 | |
---|
11479 | 11505 | void DrawObject(GL gl, boolean draw) |
---|
11480 | 11506 | { |
---|
| 11507 | + // To clear camera values |
---|
| 11508 | + ResetOptions(); |
---|
| 11509 | + |
---|
11481 | 11510 | //System.out.println("DRAW OBJECT " + mouseDown); |
---|
11482 | 11511 | // DrawMode() = SELECTION; |
---|
11483 | 11512 | //GL gl = getGL(); |
---|
.. | .. |
---|
12045 | 12074 | for (int i = tp.size(); --i >= 0;) |
---|
12046 | 12075 | { |
---|
12047 | 12076 | //for (int count = tp.get(i).GetTransformCount(); --count>=0;) |
---|
12048 | | - LA.xformPos(light, tp.get(i).GlobalTransform(), light); |
---|
| 12077 | + LA.xformPos(light, tp.get(i).GlobalTransformInv(), light); |
---|
12049 | 12078 | } |
---|
12050 | 12079 | |
---|
12051 | 12080 | |
---|
.. | .. |
---|
13315 | 13344 | /*static*/ float[] modelParams5 = new float[]{0, 0, 0, 0}; // texture, opacity, fakedepth, shadowbias |
---|
13316 | 13345 | /*static*/ float[] modelParams6 = new float[]{0, 0, 0, 0}; // bump, noise, borderfade, fog punchthrough |
---|
13317 | 13346 | /*static*/ float[] modelParams7 = new float[]{0, 0, 0, 0}; // noise power, opacity power |
---|
13318 | | - Object3D.cVector2[] vector2buffer; |
---|
| 13347 | + |
---|
| 13348 | + //Object3D.cVector2[] vector2buffer; |
---|
13319 | 13349 | |
---|
13320 | 13350 | // IN : ndotl, ndoth, xxx, NdotL //, snininess, lightarea |
---|
13321 | 13351 | // OUT : diff, spec |
---|
.. | .. |
---|
13838 | 13868 | else |
---|
13839 | 13869 | if (evt.getSource() == AAtimer) |
---|
13840 | 13870 | { |
---|
| 13871 | + Globals.TIMERRUNNING = false; |
---|
13841 | 13872 | if (mouseDown) |
---|
13842 | 13873 | { |
---|
13843 | 13874 | //new Exception().printStackTrace(); |
---|
.. | .. |
---|
13912 | 13943 | return; |
---|
13913 | 13944 | |
---|
13914 | 13945 | AAtimer.restart(); // |
---|
| 13946 | + Globals.TIMERRUNNING = true; |
---|
13915 | 13947 | |
---|
13916 | 13948 | // waslive = LIVE; |
---|
13917 | 13949 | // LIVE = false; |
---|
.. | .. |
---|
14375 | 14407 | info.camera = renderCamera; |
---|
14376 | 14408 | info.x = x; |
---|
14377 | 14409 | info.y = y; |
---|
14378 | | - object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
| 14410 | + object.GetWindow().copy |
---|
| 14411 | + .doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
14379 | 14412 | } else |
---|
14380 | 14413 | { |
---|
14381 | 14414 | if (x < startX) |
---|
.. | .. |
---|
14539 | 14572 | ci.camera = renderCamera; |
---|
14540 | 14573 | if (!isRenderer) |
---|
14541 | 14574 | { |
---|
14542 | | - if (object.editWindow.copy.doEditClick(ci, 0)) |
---|
| 14575 | + //ObjEditor editWindow = object.editWindow; |
---|
| 14576 | + //Object3D copy = editWindow.copy; |
---|
| 14577 | + if (object.doEditClick(ci, 0)) |
---|
14543 | 14578 | { |
---|
14544 | 14579 | setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); |
---|
14545 | 14580 | } else |
---|
.. | .. |
---|
15373 | 15408 | } |
---|
15374 | 15409 | */ |
---|
15375 | 15410 | |
---|
15376 | | - object.editWindow.EditSelection(); |
---|
| 15411 | + object.editWindow.EditSelection(false); |
---|
15377 | 15412 | } |
---|
15378 | 15413 | |
---|
15379 | 15414 | void SelectParent() |
---|
.. | .. |
---|
16385 | 16420 | cStatic.objectstack[materialdepth++] = checker; |
---|
16386 | 16421 | //System.out.println("material " + material); |
---|
16387 | 16422 | //Applet3D.tracein(this, selected); |
---|
16388 | | - vector2buffer = checker.projectedVertices; |
---|
| 16423 | + //vector2buffer = checker.projectedVertices; |
---|
16389 | 16424 | |
---|
16390 | 16425 | //checker.GetMaterial().Draw(this, false); // true); |
---|
16391 | | - DrawMaterial(checker.GetMaterial(), false); // true); |
---|
| 16426 | + DrawMaterial(checker.GetMaterial(), false, checker.projectedVertices); // true); |
---|
16392 | 16427 | |
---|
16393 | 16428 | materialdepth -= 1; |
---|
16394 | 16429 | if (materialdepth > 0) |
---|
16395 | 16430 | { |
---|
16396 | | - vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
16397 | | - 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); |
---|
16398 | 16433 | } |
---|
16399 | 16434 | //checker.GetMaterial().opacity = 1f; |
---|
16400 | 16435 | ////checker.GetMaterial().ambient = 1f; |
---|
.. | .. |
---|
16618 | 16653 | // System.err.println("view = " + view[8] + " " + view[9] + " " + view[10] + " " + view[11]); |
---|
16619 | 16654 | // System.err.println("view = " + view[12] + " " + view[13] + " " + view[14] + " " + view[15]); |
---|
16620 | 16655 | |
---|
| 16656 | + CreateSelectedPoint(); |
---|
| 16657 | + |
---|
16621 | 16658 | // Will fit the mesh !!! |
---|
16622 | 16659 | selectedpoint.toParent[0][0] = 0.0001; |
---|
16623 | 16660 | selectedpoint.toParent[1][1] = 0.0001; |
---|