CameraPane.java | ●●●●● patch | view | raw | blame | history | |
Globals.java | ●●●●● patch | view | raw | blame | history | |
Grafreed.java | ●●●●● patch | view | raw | blame | history | |
GroupEditor.java | ●●●●● patch | view | raw | blame | history | |
Mocap.java | ●●●●● patch | view | raw | blame | history | |
Object3D.java | ●●●●● patch | view | raw | blame | history | |
cRadio.java | ●●●●● patch | view | raw | blame | history |
CameraPane.java
.. .. @@ -326,7 +326,7 @@ 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,7 +358,7 @@ 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,8 +382,8 @@ 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,8 +400,8 @@ 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,8 +421,8 @@ 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,7 +1610,7 @@ 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,7 +1645,7 @@ 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,9 +1753,9 @@ 1753 1753 display.modelParams7[2] = 0; 1754 1754 display.modelParams7[3] = 0; 1755 1755 1756 - display.modelParams6[0] = 100; // criss de bug de bump1756 + //display.modelParams6[0] = 100; // criss de bug de bump1757 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 .. .. @@ -10548,7 +10548,8 @@ 10548 10548 ambientOcclusion = false; 10549 10549 } 10550 10550 10551 - if (Globals.lighttouched && DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN)10551 + if (//Globals.lighttouched &&10552 + DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN)10552 10553 { 10553 10554 //if (RENDERSHADOW) // ? 10554 10555 if (!IsFrozen()) .. .. @@ -13315,7 +13316,8 @@ 13315 13316 /*static*/ float[] modelParams5 = new float[]{0, 0, 0, 0}; // texture, opacity, fakedepth, shadowbias 13316 13317 /*static*/ float[] modelParams6 = new float[]{0, 0, 0, 0}; // bump, noise, borderfade, fog punchthrough 13317 13318 /*static*/ float[] modelParams7 = new float[]{0, 0, 0, 0}; // noise power, opacity power 13318 - Object3D.cVector2[] vector2buffer;13319 +13320 + //Object3D.cVector2[] vector2buffer;13319 13321 13320 13322 // IN : ndotl, ndoth, xxx, NdotL //, snininess, lightarea 13321 13323 // OUT : diff, spec .. .. @@ -14539,7 +14541,9 @@ 14539 14541 ci.camera = renderCamera; 14540 14542 if (!isRenderer) 14541 14543 { 14542 - if (object.editWindow.copy.doEditClick(ci, 0))14544 + ObjEditor editWindow = object.editWindow;14545 + Object3D copy = editWindow.copy;14546 + if (copy.doEditClick(ci, 0))14543 14547 { 14544 14548 setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); 14545 14549 } else .. .. @@ -16385,16 +16389,16 @@ 16385 16389 cStatic.objectstack[materialdepth++] = checker; 16386 16390 //System.out.println("material " + material); 16387 16391 //Applet3D.tracein(this, selected); 16388 - vector2buffer = checker.projectedVertices;16392 + //vector2buffer = checker.projectedVertices;16389 16393 16390 16394 //checker.GetMaterial().Draw(this, false); // true); 16391 - DrawMaterial(checker.GetMaterial(), false); // true);16395 + DrawMaterial(checker.GetMaterial(), false, checker.projectedVertices); // true);16392 16396 16393 16397 materialdepth -= 1; 16394 16398 if (materialdepth > 0) 16395 16399 { 16396 - vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;16397 - DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1]);16400 + //vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;16401 + DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1], cStatic.objectstack[materialdepth - 1].projectedVertices);16398 16402 } 16399 16403 //checker.GetMaterial().opacity = 1f; 16400 16404 ////checker.GetMaterial().ambient = 1f; Globals.java
.. .. @@ -7,6 +7,7 @@ 7 7 static iCameraPane theRenderer; 8 8 9 9 private static boolean LIVE = false; 10 + public static boolean COMPUTESHADOWWHENLIVE = true;10 11 public static boolean RENDERSHADOW = true; 11 12 12 13 public static boolean MOUSEDRAGGED = false; Grafreed.java
.. .. @@ -876,7 +876,7 @@ 876 876 static int depth = 0; 877 877 static java.util.Stack stack = new java.util.Stack(); 878 878 static boolean traceoff = false; // true; 879 - static float[] colorV = new float[5];879 + static float[] colorV = new float[4]; // 5];880 880 881 881 static void traceon() 882 882 { GroupEditor.java
.. .. @@ -808,11 +808,19 @@ 808 808 // debugCB.addItemListener(this); 809 809 810 810 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); 811 + oeilCB.setToolTipText("Move camera when tracking target");811 812 oeilCB.addItemListener(this); 812 813 814 + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);815 + shadowCB.setToolTipText("Compute shadows when live");816 + shadowCB.addItemListener(this);817 +818 + if (Globals.ADVANCED)819 + {813 820 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); 814 821 lookAtCB.setToolTipText("Look-at target"); 815 822 lookAtCB.addItemListener(this); 823 + }816 824 817 825 } 818 826 .. .. @@ -827,6 +835,14 @@ 827 835 void EditObject(Object3D obj) 828 836 { 829 837 cRadio radioButton = new cRadio(obj.name); 838 +839 + // Patch to avoid bug with transparency.840 + radioButton.hadMaterial = obj.material != null;841 + if (!radioButton.hadMaterial)842 + {843 + obj.material = new cMaterial();844 + }845 +830 846 radioButton.SetObject(obj); 831 847 radioButton.layout = sevenButton; 832 848 radioButton.SetCamera(cameraView.renderCamera, false); .. .. @@ -863,7 +879,9 @@ 863 879 JCheckBox speakerCameraCB; 864 880 JCheckBox speakerFocusCB; 865 881 JCheckBox debugCB; 882 +866 883 JCheckBox oeilCB; 884 + JCheckBox shadowCB;867 885 JCheckBox lookAtCB; 868 886 869 887 // static int COLOR = 1; .. .. @@ -966,6 +984,10 @@ 966 984 else if(e.getSource() == oeilCB) 967 985 { 968 986 cameraView.ToggleOeil(); 987 + }988 + else if(e.getSource() == shadowCB)989 + {990 + Globals.COMPUTESHADOWWHENLIVE ^= true;969 991 } 970 992 else if(e.getSource() == lookAtCB) 971 993 { .. .. @@ -3126,8 +3148,14 @@ 3126 3148 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) 3127 3149 { 3128 3150 ab = (cRadio)e.nextElement(); 3129 - if(ab.getModel().isSelected() && ab.GetObject() != client)3151 + if (ab.getModel().isSelected() && ab.GetObject() != client)3130 3152 { 3153 + // Patch to avoid bug with transparency.3154 + if (!ab.hadMaterial)3155 + {3156 + ab.object.material = null;3157 + }3158 +3131 3159 buttonGroup.remove(ab); 3132 3160 radioPanel.remove(ab); 3133 3161 Mocap.java
.. .. @@ -3915,7 +3915,7 @@ 3915 3915 // return; 3916 3916 3917 3917 if (//!restarted && /*display.restartframe &&*/ 3918 - Globals.isLIVE() && live && (display.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW))3918 + Globals.isLIVE() && live && (display.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE))3919 3919 { 3920 3920 //display.restartframe = false; 3921 3921 restarted = true; Object3D.java
.. .. @@ -881,7 +881,7 @@ 881 881 882 882 if (marked && Globals.isLIVE() && live && 883 883 //TEMP21aug2018 884 - (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) &&884 + (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) &&885 885 currentframe != Globals.framecount) 886 886 { 887 887 currentframe = Globals.framecount; .. .. @@ -966,6 +966,7 @@ 966 966 if (material == null || material.multiply) 967 967 return true; 968 968 969 + // Transparent objects are dynamic because we have to sort the triangles.969 970 return material.opacity > 0.99; 970 971 } 971 972 .. .. @@ -5750,7 +5751,7 @@ 5750 5751 support = support; 5751 5752 5752 5753 //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); 5753 - boolean usecalllists = IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);5754 + boolean usecalllists = !IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);5754 5755 5755 5756 if (!usecalllists && bRep != null && bRep.displaylist > 0) 5756 5757 { .. .. @@ -5771,7 +5772,7 @@ 5771 5772 5772 5773 if (!selectmode && //display.DrawMode() != display.SELECTION && 5773 5774 //(touched || (bRep != null && bRep.displaylist <= 0))) 5774 - (Globals.isLIVE() || touched && (bRep != null && bRep.displaylist <= 0)))5775 + (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && (bRep != null && bRep.displaylist <= 0)))5775 5776 { 5776 5777 Globals.lighttouched = true; 5777 5778 } // all panes... cRadio.java
.. .. @@ -38,6 +38,9 @@ 38 38 byte[] graphs[] = new byte[10000][]; 39 39 int undoindex = 0; 40 40 41 + // Patch to avoid bug with transparency.42 + boolean hadMaterial;43 +41 44 Object3D object; 42 45 Camera camera; 43 46 cButton layout;