.. | .. |
---|
56 | 56 | static int CURRENTANTIALIAS = 0; // 1; |
---|
57 | 57 | /*static*/ boolean RENDERSHADOW = true; |
---|
58 | 58 | /*static*/ int RENDERPROGRAM = 2; // 0 == none, 1 == fast, 2 == normal |
---|
59 | | - static boolean ANIMATION = false; |
---|
60 | | - static String filename; |
---|
61 | 59 | |
---|
62 | 60 | boolean DISPLAYTEXT = false; |
---|
63 | 61 | //boolean REDUCETEXTURE = true; |
---|
.. | .. |
---|
92 | 90 | |
---|
93 | 91 | static int tickcount = 0; // slow pose issue |
---|
94 | 92 | |
---|
| 93 | +static boolean BUTTONLESSWHEEL = false; |
---|
| 94 | +static boolean ZOOMBOXMODE = false; |
---|
95 | 95 | static boolean BOXMODE = false; |
---|
96 | 96 | static boolean IMAGEFLIP = false; |
---|
97 | 97 | static boolean SMOOTHFOCUS = false; |
---|
.. | .. |
---|
106 | 106 | static boolean OEIL = true; |
---|
107 | 107 | static boolean OEILONCE = false; // do oeilon then oeiloff |
---|
108 | 108 | static boolean LOOKAT = true; |
---|
109 | | -static boolean RANDOM = true; // false; |
---|
| 109 | +static boolean SWITCH = true; // false; |
---|
110 | 110 | static boolean HANDLES = false; // selection doesn't work!! |
---|
111 | 111 | static boolean PAINTMODE = false; |
---|
112 | 112 | |
---|
.. | .. |
---|
223 | 223 | public boolean IsBoxMode() |
---|
224 | 224 | { |
---|
225 | 225 | return BOXMODE; |
---|
| 226 | + } |
---|
| 227 | + |
---|
| 228 | + public boolean IsZoomBoxMode() |
---|
| 229 | + { |
---|
| 230 | + return ZOOMBOXMODE; |
---|
226 | 231 | } |
---|
227 | 232 | |
---|
228 | 233 | public void ClearDepth() |
---|
.. | .. |
---|
1612 | 1617 | //col.getColorComponents(ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB), CameraPane.modelParams0); |
---|
1613 | 1618 | if (!material.multiply) |
---|
1614 | 1619 | { |
---|
1615 | | - display.color = color; |
---|
| 1620 | + display.color = material.color; |
---|
1616 | 1621 | display.saturation = material.modulation; |
---|
1617 | 1622 | } |
---|
1618 | 1623 | else |
---|
1619 | 1624 | { |
---|
1620 | | - display.color *= color*2; |
---|
| 1625 | + display.color *= material.color*2; |
---|
1621 | 1626 | display.saturation *= material.modulation*2; |
---|
1622 | 1627 | } |
---|
1623 | 1628 | |
---|
.. | .. |
---|
2170 | 2175 | BOXMODE ^= true; |
---|
2171 | 2176 | } |
---|
2172 | 2177 | |
---|
| 2178 | + public void ToggleZoomBoxMode() |
---|
| 2179 | + { |
---|
| 2180 | + ZOOMBOXMODE ^= true; |
---|
| 2181 | + } |
---|
| 2182 | + |
---|
2173 | 2183 | public void ToggleSmoothFocus() |
---|
2174 | 2184 | { |
---|
2175 | 2185 | SMOOTHFOCUS ^= true; |
---|
.. | .. |
---|
2257 | 2267 | |
---|
2258 | 2268 | void ToggleRandom() |
---|
2259 | 2269 | { |
---|
2260 | | - RANDOM ^= true; |
---|
| 2270 | + SWITCH ^= true; |
---|
2261 | 2271 | } |
---|
2262 | 2272 | |
---|
2263 | 2273 | void ToggleHandles() |
---|
.. | .. |
---|
4196 | 4206 | |
---|
4197 | 4207 | com.sun.opengl.util.texture.Texture CompressTexture2(String name) |
---|
4198 | 4208 | { |
---|
| 4209 | + new Exception().printStackTrace(); |
---|
4199 | 4210 | System.exit(0); |
---|
4200 | 4211 | com.sun.opengl.util.texture.Texture texture = null; |
---|
4201 | 4212 | |
---|
.. | .. |
---|
8064 | 8075 | { |
---|
8065 | 8076 | String texname = tex; |
---|
8066 | 8077 | |
---|
8067 | | - String[] split = tex.split("Textures"); |
---|
8068 | | - if (split.length > 1) |
---|
8069 | | - texname = "/Users/nbriere/Textures" + split[split.length-1]; |
---|
8070 | | - else |
---|
8071 | | - if (!texname.startsWith("/")) |
---|
8072 | | - texname = "/Users/nbriere/Textures/" + texname; |
---|
| 8078 | +// String[] split = tex.split("Textures"); |
---|
| 8079 | +// if (split.length > 1) |
---|
| 8080 | +// texname = "/Users/nbriere/Textures" + split[split.length-1]; |
---|
| 8081 | +// else |
---|
| 8082 | +// if (!texname.startsWith("/")) |
---|
| 8083 | +// texname = "/Users/nbriere/Textures/" + texname; |
---|
| 8084 | + if (!new File(tex).exists()) |
---|
| 8085 | + { |
---|
| 8086 | + texname = javax.swing.filechooser.FileSystemView.getFileSystemView().getDefaultDirectory() + "/Textures/" + texname; |
---|
| 8087 | + } |
---|
8073 | 8088 | |
---|
8074 | 8089 | if (CACHETEXTURE) |
---|
8075 | 8090 | texture = textures.get(texname); // TEXTURE CACHE |
---|
.. | .. |
---|
9382 | 9397 | //gl.glFlush(); |
---|
9383 | 9398 | gl.glAccum(gl.GL_ACCUM, 1.0f / ACSIZE); |
---|
9384 | 9399 | |
---|
9385 | | - if (ANIMATION && ABORTED) |
---|
| 9400 | + if (Globals.ANIMATION && ABORTED) |
---|
9386 | 9401 | { |
---|
9387 | 9402 | System.err.println(" ABORTED FRAME"); |
---|
9388 | 9403 | break; |
---|
.. | .. |
---|
9412 | 9427 | setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); |
---|
9413 | 9428 | |
---|
9414 | 9429 | // save image |
---|
9415 | | - if (ANIMATION && !ABORTED) |
---|
| 9430 | + if (Globals.ANIMATION && !ABORTED) |
---|
9416 | 9431 | { |
---|
9417 | 9432 | VPwidth = viewport[2]; |
---|
9418 | 9433 | VPheight = viewport[3]; |
---|
.. | .. |
---|
9523 | 9538 | |
---|
9524 | 9539 | // imagecount++; |
---|
9525 | 9540 | |
---|
9526 | | - String fullname = filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext; |
---|
| 9541 | + String fullname = Globals.filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext; |
---|
9527 | 9542 | |
---|
9528 | 9543 | if (!BOXMODE) |
---|
9529 | 9544 | { |
---|
.. | .. |
---|
11247 | 11262 | { |
---|
11248 | 11263 | renderpass++; |
---|
11249 | 11264 | // System.out.println("Draw object... "); |
---|
| 11265 | + STEP = 1; |
---|
11250 | 11266 | if (FAST) // in case there is no script |
---|
11251 | | - STEP = 16; |
---|
| 11267 | + STEP = 8; |
---|
| 11268 | + |
---|
| 11269 | + if (CURRENTANTIALIAS == 0 || ACSIZE == 1) |
---|
| 11270 | + { |
---|
| 11271 | + STEP *= 4; |
---|
| 11272 | + } |
---|
11252 | 11273 | |
---|
11253 | 11274 | //object.FullInvariants(); |
---|
11254 | 11275 | |
---|
.. | .. |
---|
12586 | 12607 | "MAX ndotl.x, ndotl.x, -ndotl.x;" + |
---|
12587 | 12608 | |
---|
12588 | 12609 | "SUB temp.x, one.x, ndotl.x;" + |
---|
12589 | | - "ADD temp.x, temp.x, options2.z;" + // lightsheen |
---|
12590 | | - "ADD temp.y, one.y, options2.y;" + // sursurface |
---|
| 12610 | + // Tuning for default skin |
---|
| 12611 | + //"ADD temp.x, temp.x, options2.z;" + // lightsheen |
---|
| 12612 | + "MAD temp.x, options2.z, half.y, temp.x;" + // lightsheen |
---|
| 12613 | + "ADD temp.y, one.y, options2.y;" + // subsurface |
---|
12591 | 12614 | "MUL temp.x, temp.x, temp.y;" + |
---|
12592 | 12615 | |
---|
12593 | 12616 | "MUL saturation, saturation, temp.xxxx;" + |
---|
.. | .. |
---|
13523 | 13546 | |
---|
13524 | 13547 | //System.err.println("Dtime = " + Dtime + "; units = " + e.getUnitsToScroll() + "; ratio (units/ms) = " + ratio); |
---|
13525 | 13548 | |
---|
| 13549 | + if (BUTTONLESSWHEEL) |
---|
13526 | 13550 | if (Math.abs(ratio) < 0.1 || Math.abs(Dtime) == 0) // < 30) |
---|
13527 | 13551 | { |
---|
13528 | 13552 | return; |
---|
.. | .. |
---|
13531 | 13555 | boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK); |
---|
13532 | 13556 | |
---|
13533 | 13557 | // TIMER |
---|
13534 | | - if (!wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR |
---|
| 13558 | + if (ZOOMBOXMODE && !wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR |
---|
13535 | 13559 | { |
---|
13536 | 13560 | keepboxmode = BOXMODE; |
---|
13537 | 13561 | keepsupport = SUPPORT; |
---|
.. | .. |
---|
13748 | 13772 | |
---|
13749 | 13773 | public void mouseDragged(MouseEvent e) |
---|
13750 | 13774 | { |
---|
| 13775 | + //System.out.println("mouseDragged: " + e); |
---|
13751 | 13776 | if (isRenderer) |
---|
13752 | 13777 | movingcamera = true; |
---|
13753 | 13778 | //if (drawing) |
---|
13754 | 13779 | //return; |
---|
13755 | | - //System.out.println("mouseDragged: " + e); |
---|
13756 | 13780 | if ((e.getModifiersEx() & CTRL) != 0 |
---|
13757 | 13781 | || (e.getModifiersEx() & COMMAND) != 0) // || IsFrozen()) |
---|
13758 | 13782 | { |
---|
.. | .. |
---|
13933 | 13957 | |
---|
13934 | 13958 | public void run() |
---|
13935 | 13959 | { |
---|
| 13960 | + new Exception().printStackTrace(); |
---|
13936 | 13961 | System.exit(0); |
---|
13937 | 13962 | for (;;) |
---|
13938 | 13963 | { |
---|
.. | .. |
---|
14287 | 14312 | public void mouseMoved(MouseEvent e) |
---|
14288 | 14313 | { |
---|
14289 | 14314 | //System.out.println("mouseMoved: " + e); |
---|
14290 | | - |
---|
14291 | 14315 | if (isRenderer) |
---|
14292 | 14316 | return; |
---|
14293 | 14317 | |
---|
.. | .. |
---|
14465 | 14489 | } |
---|
14466 | 14490 | |
---|
14467 | 14491 | boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK); |
---|
14468 | | - if (capsLocked || (modifiers & META) == META) |
---|
| 14492 | + if (capsLocked) // || (modifiers & META) == META) |
---|
14469 | 14493 | { |
---|
14470 | 14494 | mouseMode |= VR; // BACKFORTH; |
---|
14471 | 14495 | } |
---|
.. | .. |
---|
15100 | 15124 | |
---|
15101 | 15125 | protected void processMouseMotionEvent(MouseEvent e) |
---|
15102 | 15126 | { |
---|
15103 | | - //System.out.println("processMouseMotionEvent: " + mouseMode); |
---|
15104 | | - if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0) |
---|
| 15127 | + //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton()); |
---|
| 15128 | + //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0) |
---|
| 15129 | + if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (e.getModifiers() & MouseEvent.BUTTON3_MASK) == 0 && (mouseMode & SELECT) == 0) |
---|
15105 | 15130 | { |
---|
15106 | 15131 | mouseMoved(e); |
---|
15107 | 15132 | } else |
---|
.. | .. |
---|
15131 | 15156 | |
---|
15132 | 15157 | void SelectParent() |
---|
15133 | 15158 | { |
---|
| 15159 | + new Exception().printStackTrace(); |
---|
15134 | 15160 | System.exit(0); |
---|
15135 | 15161 | Composite group = (Composite) object; |
---|
15136 | 15162 | java.util.Vector selectees = new java.util.Vector(group.selection); |
---|
.. | .. |
---|
15154 | 15180 | |
---|
15155 | 15181 | void SelectChildren() |
---|
15156 | 15182 | { |
---|
| 15183 | + new Exception().printStackTrace(); |
---|
15157 | 15184 | System.exit(0); |
---|
15158 | 15185 | /* |
---|
15159 | 15186 | Composite group = (Composite) object; |
---|
.. | .. |
---|
16267 | 16294 | { |
---|
16268 | 16295 | if (!selection) |
---|
16269 | 16296 | { |
---|
| 16297 | + new Exception().printStackTrace(); |
---|
16270 | 16298 | System.exit(0); |
---|
16271 | 16299 | return; |
---|
16272 | 16300 | } |
---|