Normand Briere
2019-05-05 1e3de699b037989e8deded5c7830139f97c64136
CameraPane.java
....@@ -56,8 +56,6 @@
5656 static int CURRENTANTIALIAS = 0; // 1;
5757 /*static*/ boolean RENDERSHADOW = true;
5858 /*static*/ int RENDERPROGRAM = 2; // 0 == none, 1 == fast, 2 == normal
59
- static boolean ANIMATION = false;
60
- static String filename;
6159
6260 boolean DISPLAYTEXT = false;
6361 //boolean REDUCETEXTURE = true;
....@@ -92,6 +90,8 @@
9290
9391 static int tickcount = 0; // slow pose issue
9492
93
+static boolean BUTTONLESSWHEEL = false;
94
+static boolean ZOOMBOXMODE = false;
9595 static boolean BOXMODE = false;
9696 static boolean IMAGEFLIP = false;
9797 static boolean SMOOTHFOCUS = false;
....@@ -106,7 +106,7 @@
106106 static boolean OEIL = true;
107107 static boolean OEILONCE = false; // do oeilon then oeiloff
108108 static boolean LOOKAT = true;
109
-static boolean RANDOM = true; // false;
109
+static boolean SWITCH = true; // false;
110110 static boolean HANDLES = false; // selection doesn't work!!
111111 static boolean PAINTMODE = false;
112112
....@@ -223,6 +223,11 @@
223223 public boolean IsBoxMode()
224224 {
225225 return BOXMODE;
226
+ }
227
+
228
+ public boolean IsZoomBoxMode()
229
+ {
230
+ return ZOOMBOXMODE;
226231 }
227232
228233 public void ClearDepth()
....@@ -1612,12 +1617,12 @@
16121617 //col.getColorComponents(ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB), CameraPane.modelParams0);
16131618 if (!material.multiply)
16141619 {
1615
- display.color = color;
1620
+ display.color = material.color;
16161621 display.saturation = material.modulation;
16171622 }
16181623 else
16191624 {
1620
- display.color *= color*2;
1625
+ display.color *= material.color*2;
16211626 display.saturation *= material.modulation*2;
16221627 }
16231628
....@@ -2170,6 +2175,11 @@
21702175 BOXMODE ^= true;
21712176 }
21722177
2178
+ public void ToggleZoomBoxMode()
2179
+ {
2180
+ ZOOMBOXMODE ^= true;
2181
+ }
2182
+
21732183 public void ToggleSmoothFocus()
21742184 {
21752185 SMOOTHFOCUS ^= true;
....@@ -2257,7 +2267,7 @@
22572267
22582268 void ToggleRandom()
22592269 {
2260
- RANDOM ^= true;
2270
+ SWITCH ^= true;
22612271 }
22622272
22632273 void ToggleHandles()
....@@ -4196,6 +4206,7 @@
41964206
41974207 com.sun.opengl.util.texture.Texture CompressTexture2(String name)
41984208 {
4209
+ new Exception().printStackTrace();
41994210 System.exit(0);
42004211 com.sun.opengl.util.texture.Texture texture = null;
42014212
....@@ -8064,12 +8075,16 @@
80648075 {
80658076 String texname = tex;
80668077
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
+ }
80738088
80748089 if (CACHETEXTURE)
80758090 texture = textures.get(texname); // TEXTURE CACHE
....@@ -9382,7 +9397,7 @@
93829397 //gl.glFlush();
93839398 gl.glAccum(gl.GL_ACCUM, 1.0f / ACSIZE);
93849399
9385
- if (ANIMATION && ABORTED)
9400
+ if (Globals.ANIMATION && ABORTED)
93869401 {
93879402 System.err.println(" ABORTED FRAME");
93889403 break;
....@@ -9412,7 +9427,7 @@
94129427 setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
94139428
94149429 // save image
9415
- if (ANIMATION && !ABORTED)
9430
+ if (Globals.ANIMATION && !ABORTED)
94169431 {
94179432 VPwidth = viewport[2];
94189433 VPheight = viewport[3];
....@@ -9523,7 +9538,7 @@
95239538
95249539 // imagecount++;
95259540
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;
95279542
95289543 if (!BOXMODE)
95299544 {
....@@ -11247,8 +11262,14 @@
1124711262 {
1124811263 renderpass++;
1124911264 // System.out.println("Draw object... ");
11265
+ STEP = 1;
1125011266 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
+ }
1125211273
1125311274 //object.FullInvariants();
1125411275
....@@ -12586,8 +12607,10 @@
1258612607 "MAX ndotl.x, ndotl.x, -ndotl.x;" +
1258712608
1258812609 "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
1259112614 "MUL temp.x, temp.x, temp.y;" +
1259212615
1259312616 "MUL saturation, saturation, temp.xxxx;" +
....@@ -13523,6 +13546,7 @@
1352313546
1352413547 //System.err.println("Dtime = " + Dtime + "; units = " + e.getUnitsToScroll() + "; ratio (units/ms) = " + ratio);
1352513548
13549
+ if (BUTTONLESSWHEEL)
1352613550 if (Math.abs(ratio) < 0.1 || Math.abs(Dtime) == 0) // < 30)
1352713551 {
1352813552 return;
....@@ -13531,7 +13555,7 @@
1353113555 boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
1353213556
1353313557 // TIMER
13534
- if (!wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR
13558
+ if (ZOOMBOXMODE && !wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR
1353513559 {
1353613560 keepboxmode = BOXMODE;
1353713561 keepsupport = SUPPORT;
....@@ -13748,11 +13772,11 @@
1374813772
1374913773 public void mouseDragged(MouseEvent e)
1375013774 {
13775
+ //System.out.println("mouseDragged: " + e);
1375113776 if (isRenderer)
1375213777 movingcamera = true;
1375313778 //if (drawing)
1375413779 //return;
13755
- //System.out.println("mouseDragged: " + e);
1375613780 if ((e.getModifiersEx() & CTRL) != 0
1375713781 || (e.getModifiersEx() & COMMAND) != 0) // || IsFrozen())
1375813782 {
....@@ -13933,6 +13957,7 @@
1393313957
1393413958 public void run()
1393513959 {
13960
+ new Exception().printStackTrace();
1393613961 System.exit(0);
1393713962 for (;;)
1393813963 {
....@@ -14287,7 +14312,6 @@
1428714312 public void mouseMoved(MouseEvent e)
1428814313 {
1428914314 //System.out.println("mouseMoved: " + e);
14290
-
1429114315 if (isRenderer)
1429214316 return;
1429314317
....@@ -14465,7 +14489,7 @@
1446514489 }
1446614490
1446714491 boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
14468
- if (capsLocked || (modifiers & META) == META)
14492
+ if (capsLocked) // || (modifiers & META) == META)
1446914493 {
1447014494 mouseMode |= VR; // BACKFORTH;
1447114495 }
....@@ -15100,8 +15124,9 @@
1510015124
1510115125 protected void processMouseMotionEvent(MouseEvent e)
1510215126 {
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)
1510515130 {
1510615131 mouseMoved(e);
1510715132 } else
....@@ -15131,6 +15156,7 @@
1513115156
1513215157 void SelectParent()
1513315158 {
15159
+ new Exception().printStackTrace();
1513415160 System.exit(0);
1513515161 Composite group = (Composite) object;
1513615162 java.util.Vector selectees = new java.util.Vector(group.selection);
....@@ -15154,6 +15180,7 @@
1515415180
1515515181 void SelectChildren()
1515615182 {
15183
+ new Exception().printStackTrace();
1515715184 System.exit(0);
1515815185 /*
1515915186 Composite group = (Composite) object;
....@@ -16267,6 +16294,7 @@
1626716294 {
1626816295 if (!selection)
1626916296 {
16297
+ new Exception().printStackTrace();
1627016298 System.exit(0);
1627116299 return;
1627216300 }