Normand Briere
2019-06-11 5e6a6f3319f0c4c687fe71952ac9ecc17792b83a
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
....@@ -191,9 +191,43 @@
191191
192192 /// INTERFACE
193193
194
+ public javax.media.opengl.GL GetGL0()
195
+ {
196
+ return null;
197
+ }
198
+
199
+ public int GenList()
200
+ {
201
+ javax.media.opengl.GL gl = GetGL();
202
+ return gl.glGenLists(1);
203
+ }
204
+
205
+ public void NewList(int id)
206
+ {
207
+ javax.media.opengl.GL gl = GetGL();
208
+ gl.glNewList(id, gl.GL_COMPILE); //_AND_EXECUTE);
209
+ }
210
+
211
+ public void CallList(int id)
212
+ {
213
+ javax.media.opengl.GL gl = GetGL();
214
+ gl.glCallList(id);
215
+ }
216
+
217
+ public void EndList()
218
+ {
219
+ javax.media.opengl.GL gl = GetGL();
220
+ gl.glEndList();
221
+ }
222
+
194223 public boolean IsBoxMode()
195224 {
196225 return BOXMODE;
226
+ }
227
+
228
+ public boolean IsZoomBoxMode()
229
+ {
230
+ return ZOOMBOXMODE;
197231 }
198232
199233 public void ClearDepth()
....@@ -1059,7 +1093,336 @@
10591093 gl.glMatrixMode(gl.GL_MODELVIEW);
10601094 }
10611095
1096
+ public void DrawBox(cVector min, cVector max)
1097
+ {
1098
+ javax.media.opengl.GL gl = GetGL();
1099
+ gl.glBegin(gl.GL_LINES);
1100
+
1101
+ gl.glVertex3d(min.x, min.y, min.z);
1102
+ gl.glVertex3d(min.x, min.y, max.z);
1103
+ gl.glVertex3d(min.x, min.y, min.z);
1104
+ gl.glVertex3d(min.x, max.y, min.z);
1105
+ gl.glVertex3d(min.x, min.y, min.z);
1106
+ gl.glVertex3d(max.x, min.y, min.z);
1107
+
1108
+ gl.glVertex3d(max.x, max.y, max.z);
1109
+ gl.glVertex3d(min.x, max.y, max.z);
1110
+ gl.glVertex3d(max.x, max.y, max.z);
1111
+ gl.glVertex3d(max.x, min.y, max.z);
1112
+ gl.glVertex3d(max.x, max.y, max.z);
1113
+ gl.glVertex3d(max.x, max.y, min.z);
1114
+
1115
+ gl.glEnd();
1116
+ }
1117
+
1118
+ public void DrawGeometry(BoundaryRep bRep, boolean flipV, boolean selectmode)
1119
+ {
1120
+ int[] strips = bRep.getRawIndices();
1121
+
1122
+ javax.media.opengl.GL gl = GetGL();
1123
+
1124
+ // TRIANGLE STRIP ARRAY
1125
+ if (bRep.trimmed)
1126
+ {
1127
+ float[] v = bRep.getRawVertices();
1128
+ float[] n = bRep.getRawNormals();
1129
+ float[] c = bRep.getRawColors();
1130
+ float[] uv = bRep.getRawUVMap();
1131
+
1132
+ int count2 = 0;
1133
+ int count3 = 0;
1134
+
1135
+ if (n.length > 0)
1136
+ {
1137
+ for (int i = 0; i < strips.length; i++)
1138
+ {
1139
+ gl.glBegin(gl.GL_TRIANGLE_STRIP);
1140
+
1141
+ /*
1142
+ boolean locked = false;
1143
+ float eps = 0.1f;
1144
+ boolean wrap = CameraPane.UVWRAP; // true; // UV WRAP TEXTURE ISSUE: true = artifacts, false = nice
1145
+
1146
+ int dot = 0;
1147
+
1148
+ if ((dot&1) == 0)
1149
+ dot |= (Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps) ? 3 : 1;
1150
+
1151
+ if (wrap || (dot&2) != 0) // Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps)
1152
+ gl.glTexCoord2f((float) qv.s, (float) qv.t);
1153
+ else
1154
+ {
1155
+ locked = true;
1156
+ gl.glTexCoord2f((float) pv.s, (float) pv.t);
1157
+ }
1158
+ //System.out.println("vertexq = " + qv.x + ", " + qv.y + ", " + qv.z);
1159
+ gl.glVertex3f((float) qv.x, (float) qv.y, (float) qv.z);
1160
+ if (hasnorm)
1161
+ {
1162
+ //System.out.println("normalr = " + rv.norm.x + ", " + rv.norm.y + ", " + rv.norm.z);
1163
+ gl.glNormal3f((float) rv.norm.x, (float) rv.norm.y, (float) rv.norm.z);
1164
+ }
1165
+
1166
+ if ((dot&4) == 0)
1167
+ dot |= (Math.abs(rv.s - pv.s) < eps && Math.abs(rv.t - pv.t) < eps) ? 12 : 4;
1168
+
1169
+ if (wrap || !locked && (dot&8) != 0)
1170
+ gl.glTexCoord2f((float) rv.s, (float) rv.t);
1171
+ else
1172
+ gl.glTexCoord2f((float) pv.s, (float) pv.t);
1173
+
1174
+ f.dot = dot;
1175
+ */
1176
+
1177
+ if (!selectmode)
1178
+ {
1179
+ if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0)
1180
+ {
1181
+ gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]);
1182
+ } else
1183
+ {
1184
+ gl.glNormal3f(0, 0, 1);
1185
+ }
1186
+
1187
+ if (c != null)
1188
+ //System.out.println("glcolor = " + c[count3] + ", " + c[count3+1] + ", " + c[count3+2]);
1189
+ {
1190
+ gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
1191
+ }
1192
+ }
1193
+ if (flipV)
1194
+ gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
1195
+ else
1196
+ gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
1197
+ //System.out.println("vertex1 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]);
1198
+ gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
1199
+
1200
+ count2 += 2;
1201
+ count3 += 3;
1202
+ if (!selectmode)
1203
+ {
1204
+ if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0)
1205
+ {
1206
+ gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]);
1207
+ } else
1208
+ {
1209
+ gl.glNormal3f(0, 0, 1);
1210
+ }
1211
+ if (c != null)
1212
+ {
1213
+ gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
1214
+ }
1215
+ }
1216
+ if (flipV)
1217
+ gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
1218
+ else
1219
+ gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
1220
+ //System.out.println("vertex2 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]);
1221
+ gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
1222
+
1223
+ count2 += 2;
1224
+ count3 += 3;
1225
+ for (int j = 0; j < strips[i] - 2; j++)
1226
+ {
1227
+ //gl.glTexCoord2d(...);
1228
+ if (!selectmode)
1229
+ {
1230
+ if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0)
1231
+ {
1232
+ gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]);
1233
+ } else
1234
+ {
1235
+ gl.glNormal3f(0, 0, 1);
1236
+ }
1237
+ if (c != null)
1238
+ {
1239
+ gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
1240
+ }
1241
+ }
1242
+
1243
+ if (flipV)
1244
+ gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
1245
+ else
1246
+ gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
1247
+ //System.out.println("coord3 = " + uv[count2] + ", " + uv[count2+1]);
1248
+ gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
1249
+ count2 += 2;
1250
+ count3 += 3;
1251
+ }
1252
+
1253
+ gl.glEnd();
1254
+ }
1255
+ }
1256
+
1257
+ assert count3 == v.length;
1258
+ }
1259
+ else // !trimmed
1260
+ {
1261
+ int count = 0;
1262
+ for (int i = 0; i < strips.length; i++)
1263
+ {
1264
+ gl.glBegin(gl.GL_TRIANGLE_STRIP);
1265
+
1266
+ Vertex p = bRep.GetVertex(bRep.indices[count++]);
1267
+ Vertex q = bRep.GetVertex(bRep.indices[count++]);
1268
+
1269
+ drawVertex(gl, p, flipV, selectmode);
1270
+ drawVertex(gl, q, flipV, selectmode);
1271
+
1272
+ for (int j = 0; j < strips[i] - 2; j++)
1273
+ {
1274
+ Vertex r = bRep.GetVertex(bRep.indices[count++]);
1275
+
1276
+ // if (j%2 == 0)
1277
+ // drawFace(p, q, r, display, null);
1278
+ // else
1279
+ // drawFace(p, r, q, display, null);
1280
+
1281
+ // p = q;
1282
+ // q = r;
1283
+ drawVertex(gl, r, flipV, selectmode);
1284
+ }
1285
+
1286
+ gl.glEnd();
1287
+ }
1288
+ }
1289
+ }
1290
+
1291
+ static cSpring.Point3D temp = new cSpring.Point3D();
1292
+ static cSpring.Point3D temp2 = new cSpring.Point3D();
1293
+ static cSpring.Point3D temp3 = new cSpring.Point3D();
1294
+
1295
+ public void DrawDynamicMesh(cMesh mesh)
1296
+ {
1297
+ GL gl = GetGL(); // getGL();
1298
+
1299
+ cSpring.PhysicsController3D Phys = mesh.Phys;
1300
+
1301
+ gl.glDisable(gl.GL_LIGHTING);
1302
+
1303
+ gl.glLineWidth(1);
1304
+ gl.glColor3f(1,1,1);
1305
+ gl.glBegin(gl.GL_LINES);
1306
+ double scale = 0;
1307
+ int count = 0;
1308
+ for (int s=0; s<Phys.allSprings.size(); s++)
1309
+ {
1310
+ cSpring.Spring spring = Phys.allSprings.get(s);
1311
+ if(s == 0)
1312
+ {
1313
+ //System.out.println(" spring : " + spring.a.position + "; " + spring.b.position);
1314
+ }
1315
+ if (mesh.showsprings)
1316
+ {
1317
+ temp.set(spring.a.position);
1318
+ temp.add(spring.b.position);
1319
+ temp.mul(0.5);
1320
+ temp2.set(spring.a.position);
1321
+ temp2.sub(spring.b.position);
1322
+ temp2.mul(spring.restLength/2);
1323
+ temp.sub(temp2);
1324
+ gl.glVertex3f((float)temp.x, (float)temp.y, (float)temp.z);
1325
+ temp.add(temp2);
1326
+ temp.add(temp2);
1327
+ gl.glVertex3f((float)temp.x, (float)temp.y, (float)temp.z);
1328
+ }
1329
+
1330
+ if (spring.isHandle)
1331
+ continue;
1332
+
1333
+ //if (scale < spring.restLength)
1334
+ scale += spring.restLength;
1335
+ count++;
1336
+ }
1337
+ gl.glEnd();
1338
+
1339
+ if (count == 0)
1340
+ scale = 0.01;
1341
+ else
1342
+ scale /= count * 3;
1343
+
1344
+ //scale = 0.25;
1345
+
1346
+ if (mesh.ShowInfo())
1347
+ {
1348
+ gl.glLineWidth(4);
1349
+ for (int s=0; s<Phys.allNodes.size(); s++)
1350
+ {
1351
+ cSpring.DynamicNode node = Phys.allNodes.get(s);
1352
+ if (node.mass == 0)
1353
+ continue;
1354
+
1355
+ int i = node.springs==null?-1:node.springs.size();
1356
+ gl.glColor3f((i>>2)&1,(i>>1)&1,i&1);
1357
+ //temp.set(node.springForce.x, node.springForce.y, node.springForce.z);
1358
+ //temp.normalize();
1359
+ //gl.glColor3d((temp.x+1)/2, (temp.y+1)/2, (temp.z+1)/2);
1360
+ gl.glBegin(gl.GL_LINES);
1361
+ gl.glVertex3d(node.position.x, node.position.y, node.position.z);
1362
+ //gl.glVertex3d(node.position.x + node.normal.x*scale, node.position.y + node.normal.y*scale, node.position.z + node.normal.z*scale);
1363
+ gl.glVertex3d(node.position.x + mesh.bRep.GetVertex(s).norm.x*scale,
1364
+ node.position.y + mesh.bRep.GetVertex(s).norm.y*scale,
1365
+ node.position.z + mesh.bRep.GetVertex(s).norm.z*scale);
1366
+ gl.glEnd();
1367
+ }
1368
+
1369
+ gl.glLineWidth(8);
1370
+ for (int s=0; s<Phys.allNodes.size(); s++)
1371
+ {
1372
+ cSpring.DynamicNode node = Phys.allNodes.get(s);
1373
+
1374
+ if (node.springs != null)
1375
+ {
1376
+ for (int i=0; i<node.springs.size(); i+=1)
1377
+ {
1378
+ cSpring.DynamicNode f = node.springs.get(i).GetOther(node);
1379
+
1380
+ int c = i+1;
1381
+ // c = node.springs.get(i).nbcopies;
1382
+
1383
+ gl.glColor3f((c>>2)&1,(c>>1)&1,c&1);
1384
+ gl.glBegin(gl.GL_LINES);
1385
+ gl.glVertex3d(node.position.x, node.position.y, node.position.z);
1386
+ gl.glVertex3d(f.position.x/3+node.position.x*2/3, f.position.y/3+node.position.y*2/3, f.position.z/3+node.position.z*2/3);
1387
+ gl.glEnd();
1388
+ }
1389
+ }
1390
+ }
1391
+
1392
+ gl.glLineWidth(1);
1393
+ }
1394
+
1395
+ gl.glEnable(gl.GL_LIGHTING);
1396
+ }
1397
+
10621398 /// INTERFACE
1399
+
1400
+ public void StartTriangles()
1401
+ {
1402
+ javax.media.opengl.GL gl = GetGL();
1403
+ gl.glBegin(gl.GL_TRIANGLES);
1404
+ }
1405
+
1406
+ public void EndTriangles()
1407
+ {
1408
+ GetGL().glEnd();
1409
+ }
1410
+
1411
+ void drawVertex(javax.media.opengl.GL gl, Vertex pv, boolean flipV, boolean selectmode)
1412
+ {
1413
+ if (!selectmode)
1414
+ {
1415
+ gl.glNormal3f((float) pv.norm.x, (float) pv.norm.y, (float) pv.norm.z);
1416
+ gl.glColor4f(pv.AO, pv.AO, pv.AO, 1);
1417
+
1418
+ if (flipV)
1419
+ gl.glTexCoord2f((float) pv.s, 1-(float) pv.t);
1420
+ else
1421
+ gl.glTexCoord2f((float) pv.s, (float) pv.t);
1422
+ }
1423
+
1424
+ gl.glVertex3f((float) pv.x, (float) pv.y, (float) pv.z);
1425
+ }
10631426
10641427 void SetColor(Object3D obj, Vertex p0)
10651428 {
....@@ -1254,18 +1617,18 @@
12541617 //col.getColorComponents(ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB), CameraPane.modelParams0);
12551618 if (!material.multiply)
12561619 {
1257
- display.color = color;
1620
+ display.color = material.color;
12581621 display.saturation = material.modulation;
12591622 }
12601623 else
12611624 {
1262
- display.color *= color*2;
1625
+ display.color *= material.color*2;
12631626 display.saturation *= material.modulation*2;
12641627 }
12651628
12661629 cColor.HSBtoRGB(display.color, display.saturation, 1, display.modelParams0);
12671630
1268
- float[] colorV = GrafreeD.colorV;
1631
+ float[] colorV = Grafreed.colorV;
12691632
12701633 /**/
12711634 if (display.DrawMode() == display.DEFAULT) // && display.RENDERPROGRAM == 0)
....@@ -1777,7 +2140,7 @@
17772140 System.err.println("LIVE = " + Globals.isLIVE());
17782141
17792142 if (!Globals.isLIVE()) // save sound
1780
- GrafreeD.savesound = true; // wav.save();
2143
+ Grafreed.savesound = true; // wav.save();
17812144 // else
17822145 repaint(); // start loop // may 2013
17832146 }
....@@ -1810,6 +2173,11 @@
18102173 public void ToggleBoxMode()
18112174 {
18122175 BOXMODE ^= true;
2176
+ }
2177
+
2178
+ public void ToggleZoomBoxMode()
2179
+ {
2180
+ ZOOMBOXMODE ^= true;
18132181 }
18142182
18152183 public void ToggleSmoothFocus()
....@@ -1899,7 +2267,7 @@
18992267
19002268 void ToggleRandom()
19012269 {
1902
- RANDOM ^= true;
2270
+ SWITCH ^= true;
19032271 }
19042272
19052273 void ToggleHandles()
....@@ -3838,6 +4206,7 @@
38384206
38394207 com.sun.opengl.util.texture.Texture CompressTexture2(String name)
38404208 {
4209
+ new Exception().printStackTrace();
38414210 System.exit(0);
38424211 com.sun.opengl.util.texture.Texture texture = null;
38434212
....@@ -7653,7 +8022,7 @@
76538022 }
76548023 }
76558024
7656
- /*boolean*/ public void BindTextures(cTexture tex, int resolution) // INTERFACE
8025
+ /*boolean*/ public void BindTextures(cTexture tex, int resolution) throws Exception // INTERFACE
76578026 {
76588027 if (// DrawMode() != 0 || /*tex == null ||*/
76598028 ambientOcclusion ) // || !textureon)
....@@ -7698,7 +8067,7 @@
76988067 return; // true;
76998068 }
77008069
7701
- CacheTexture GetCacheTexture(String tex, boolean bump, int resolution)
8070
+ CacheTexture GetCacheTexture(String tex, boolean bump, int resolution) throws Exception
77028071 {
77038072 CacheTexture/*com.sun.opengl.util.texture.Texture*/ texture = null;
77048073
....@@ -7706,12 +8075,16 @@
77068075 {
77078076 String texname = tex;
77088077
7709
- String[] split = tex.split("Textures");
7710
- if (split.length > 1)
7711
- texname = "/Users/nbriere/Textures" + split[split.length-1];
7712
- else
7713
- if (!texname.startsWith("/"))
7714
- 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
+ }
77158088
77168089 if (CACHETEXTURE)
77178090 texture = textures.get(texname); // TEXTURE CACHE
....@@ -7811,7 +8184,9 @@
78118184 texturedata = GetFileTexture(cachename, processbump, resolution);
78128185
78138186
7814
- if (texturedata != null)
8187
+ if (texturedata == null)
8188
+ throw new Exception();
8189
+
78158190 texture = new CacheTexture(com.sun.opengl.util.texture.TextureIO.newTexture(texturedata),resolution);
78168191 //texture = GetTexture(tex, bump);
78178192 }
....@@ -7933,7 +8308,7 @@
79338308 return texture;
79348309 }
79358310
7936
- com.sun.opengl.util.texture.Texture GetTexture(String tex, boolean bump, int resolution)
8311
+ com.sun.opengl.util.texture.Texture GetTexture(String tex, boolean bump, int resolution) throws Exception
79378312 {
79388313 CacheTexture texture = GetCacheTexture(tex, bump, resolution);
79398314
....@@ -7951,14 +8326,14 @@
79518326 return texture!=null?texture.texture:null;
79528327 }
79538328
7954
- public com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution)
8329
+ public com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution) throws Exception
79558330 {
79568331 CacheTexture texture = GetCacheTexture(tex, bump, resolution);
79578332
79588333 return texture!=null?texture.texturedata:null;
79598334 }
79608335
7961
- boolean BindTexture(String tex, boolean bump, int resolution)
8336
+ boolean BindTexture(String tex, boolean bump, int resolution) throws Exception
79628337 {
79638338 if (/*tex == null ||*/ ambientOcclusion ) // || !textureon)
79648339 {
....@@ -9024,7 +9399,7 @@
90249399 //gl.glFlush();
90259400 gl.glAccum(gl.GL_ACCUM, 1.0f / ACSIZE);
90269401
9027
- if (ANIMATION && ABORTED)
9402
+ if (Globals.ANIMATION && ABORTED)
90289403 {
90299404 System.err.println(" ABORTED FRAME");
90309405 break;
....@@ -9054,7 +9429,7 @@
90549429 setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
90559430
90569431 // save image
9057
- if (ANIMATION && !ABORTED)
9432
+ if (Globals.ANIMATION && !ABORTED)
90589433 {
90599434 VPwidth = viewport[2];
90609435 VPheight = viewport[3];
....@@ -9165,11 +9540,11 @@
91659540
91669541 // imagecount++;
91679542
9168
- String fullname = filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext;
9543
+ String fullname = Globals.filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext;
91699544
91709545 if (!BOXMODE)
91719546 {
9172
- System.out.println("image: " + fullname + " (wav cursor=" + (GrafreeD.wav.cursor / 735 / 4) + ")");
9547
+ System.out.println("image: " + fullname + " (wav cursor=" + (Grafreed.wav.cursor / 735 / 4) + ")");
91739548 }
91749549
91759550 if (!BOXMODE)
....@@ -9207,7 +9582,7 @@
92079582 ABORTED = false;
92089583 }
92099584 else
9210
- GrafreeD.wav.cursor += 735 * ACSIZE;
9585
+ Grafreed.wav.cursor += 735 * ACSIZE;
92119586
92129587 if (false)
92139588 {
....@@ -9870,11 +10245,11 @@
987010245
987110246 public void display(GLAutoDrawable drawable)
987210247 {
9873
- if (GrafreeD.savesound && GrafreeD.hassound)
10248
+ if (Grafreed.savesound && Grafreed.hassound)
987410249 {
9875
- GrafreeD.wav.save();
9876
- GrafreeD.savesound = false;
9877
- GrafreeD.hassound = false;
10250
+ Grafreed.wav.save();
10251
+ Grafreed.savesound = false;
10252
+ Grafreed.hassound = false;
987810253 }
987910254 // if (DEBUG_SELECTION)
988010255 // {
....@@ -10004,7 +10379,7 @@
1000410379 Object3D theobject = object;
1000510380 Object3D theparent = object.parent;
1000610381 object.parent = null;
10007
- object = (Object3D)GrafreeD.clone(object);
10382
+ object = (Object3D)Grafreed.clone(object);
1000810383 object.Stripify();
1000910384 if (theobject.selection == null || theobject.selection.Size() == 0)
1001010385 theobject.PreprocessOcclusion(this);
....@@ -10017,13 +10392,13 @@
1001710392 ambientOcclusion = false;
1001810393 }
1001910394
10020
- if (Globals.lighttouched && DrawMode() == DEFAULT && !lightMode) // && !FROZEN)
10395
+ if (Globals.lighttouched && DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN)
1002110396 {
1002210397 //if (RENDERSHADOW) // ?
1002310398 if (!IsFrozen())
1002410399 {
1002510400 // dec 2012
10026
- if (!ambientOcclusion && !(!flash && !lightMode && DrawMode() == DEFAULT && ANTIALIAS > 0))
10401
+ if (!ambientOcclusion && !(!flash && DrawMode() == DEFAULT && ANTIALIAS > 0))
1002710402 {
1002810403 Globals.framecount++;
1002910404 shadowbuffer.display();
....@@ -10425,7 +10800,16 @@
1042510800 // Bump noise
1042610801 gl.glActiveTexture(GL.GL_TEXTURE6);
1042710802 //gl.glBindTexture(GL.GL_TEXTURE_2D, bump_noise);
10428
- BindTexture(NOISE_TEXTURE, false, 2);
10803
+
10804
+ try
10805
+ {
10806
+ BindTexture(NOISE_TEXTURE, false, 2);
10807
+ }
10808
+ catch (Exception e)
10809
+ {
10810
+ System.err.println("FAILED: " + NOISE_TEXTURE);
10811
+ }
10812
+
1042910813
1043010814 gl.glActiveTexture(GL.GL_TEXTURE0);
1043110815 gl.glEnable(GL.GL_TEXTURE_2D);
....@@ -10889,8 +11273,14 @@
1088911273 {
1089011274 renderpass++;
1089111275 // System.out.println("Draw object... ");
11276
+ STEP = 1;
1089211277 if (FAST) // in case there is no script
10893
- STEP = 16;
11278
+ STEP = 8;
11279
+
11280
+ if (CURRENTANTIALIAS == 0 || ACSIZE == 1)
11281
+ {
11282
+ STEP *= 4;
11283
+ }
1089411284
1089511285 //object.FullInvariants();
1089611286
....@@ -10904,8 +11294,8 @@
1090411294 e.printStackTrace();
1090511295 }
1090611296
10907
- if (GrafreeD.RENDERME > 0)
10908
- GrafreeD.RENDERME--; // mechante magouille
11297
+ if (Grafreed.RENDERME > 0)
11298
+ Grafreed.RENDERME--; // mechante magouille
1090911299
1091011300 Globals.ONESTEP = false;
1091111301 }
....@@ -10975,7 +11365,14 @@
1097511365
1097611366 usedtextures.clear();
1097711367
10978
- BindTextures(DEFAULT_TEXTURES, 2);
11368
+ try
11369
+ {
11370
+ BindTextures(DEFAULT_TEXTURES, 2);
11371
+ }
11372
+ catch (Exception e)
11373
+ {
11374
+ System.err.println("FAILED: " + DEFAULT_TEXTURES);
11375
+ }
1097911376 }
1098011377 //System.out.println("--> " + stackdepth);
1098111378 // GrafreeD.traceon();
....@@ -11066,7 +11463,14 @@
1106611463 if (checker != null && DrawMode() == DEFAULT)
1106711464 {
1106811465 //BindTexture(IMMORTAL_TEXTURE);
11069
- BindTextures(checker.GetTextures(), checker.texres);
11466
+ try
11467
+ {
11468
+ BindTextures(checker.GetTextures(), checker.texres);
11469
+ }
11470
+ catch (Exception e)
11471
+ {
11472
+ System.err.println("FAILED: " + checker.GetTextures());
11473
+ }
1107011474 // NEAREST
1107111475 GetGL().glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST); // GL.GL_LINEAR);
1107211476 DrawChecker(gl);
....@@ -11148,7 +11552,7 @@
1114811552 return;
1114911553 }
1115011554
11151
- String string = obj.GetToolTip();
11555
+ String string = obj.toString(); //.GetToolTip();
1115211556
1115311557 GL gl = GetGL();
1115411558
....@@ -12098,8 +12502,8 @@
1209812502
1209912503 // display shadow only (bump == 0)
1210012504 "SUB temp.x, half.x, shadow.x;" +
12101
- "MOV temp.y, -params6.x;" +
12102
- "SLT temp.z, temp.y, zero.x;" +
12505
+ "MOV temp.y, -params5.z;" + // params6.x;" +
12506
+ "SLT temp.z, temp.y, -one2048th.x;" +
1210312507 "SUB temp.y, one.x, temp.z;" +
1210412508 "MUL temp.x, temp.x, temp.y;" +
1210512509 "KIL temp.x;" +
....@@ -12228,8 +12632,10 @@
1222812632 "MAX ndotl.x, ndotl.x, -ndotl.x;" +
1222912633
1223012634 "SUB temp.x, one.x, ndotl.x;" +
12231
- "ADD temp.x, temp.x, options2.z;" + // lightsheen
12232
- "ADD temp.y, one.y, options2.y;" + // sursurface
12635
+ // Tuning for default skin
12636
+ //"ADD temp.x, temp.x, options2.z;" + // lightsheen
12637
+ "MAD temp.x, options2.z, half.y, temp.x;" + // lightsheen
12638
+ "ADD temp.y, one.y, options2.y;" + // subsurface
1223312639 "MUL temp.x, temp.x, temp.y;" +
1223412640
1223512641 "MUL saturation, saturation, temp.xxxx;" +
....@@ -12428,7 +12834,7 @@
1242812834 //once = true;
1242912835 }
1243012836
12431
- System.out.print("Program #" + mode + "; length = " + program.length());
12837
+ System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length());
1243212838 System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : ""));
1243312839 loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program);
1243412840
....@@ -12561,12 +12967,16 @@
1256112967
1256212968 "ADD " + depth + ".z, " + depth + ".z, temp.x;" +
1256312969 //"SUB " + depth + ".z, " + depth + ".z, temp.x;" + // back face shadowing!
12970
+
12971
+ // Compare fragment depth in light space with shadowmap.
1256412972 "SUB temp.x, fragment.texcoord[1].z, " + depth + ".z;" +
1256512973 "SGE temp.y, temp.x, zero.x;" +
12566
- "SUB " + shadow + ".y, one.x, temp.y;" +
12974
+ "SUB " + shadow + ".y, one.x, temp.y;" + // Specular is fully occluded
12975
+
12976
+ // Reverse comparison
1256712977 "SUB temp.x, one.x, temp.x;" +
1256812978 "MUL " + shadow + ".x, temp.x, temp.y;" +
12569
- "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // specular is fully occluded
12979
+ "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // diffuse
1257012980 "POW " + shadow + ".x, " + shadow + ".x, params5.z;" + // fake depth
1257112981
1257212982 "SLT " + shadow + ".z, fragment.texcoord[1].z, " + depth + ".z;" +
....@@ -12580,6 +12990,10 @@
1258012990 // No shadow for backface
1258112991 "DP3 temp.x, normal, lightd;" +
1258212992 "SLT temp.x, temp.x, zero.x;" + // shadoweps
12993
+ "LRP " + shadow + ", temp.x, one, " + shadow + ";" +
12994
+
12995
+ // No shadow when out of frustrum
12996
+ "SGE temp.x, " + depth + ".z, one.z;" +
1258312997 "LRP " + shadow + ", temp.x, one, " + shadow + ";" +
1258412998 "";
1258512999 }
....@@ -13138,7 +13552,7 @@
1313813552 public void mousePressed(MouseEvent e)
1313913553 {
1314013554 //System.out.println("mousePressed: " + e);
13141
- clickStart(e.getX(), e.getY(), e.getModifiersEx());
13555
+ clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx());
1314213556 }
1314313557
1314413558 static long prevtime = 0;
....@@ -13165,6 +13579,7 @@
1316513579
1316613580 //System.err.println("Dtime = " + Dtime + "; units = " + e.getUnitsToScroll() + "; ratio (units/ms) = " + ratio);
1316713581
13582
+ if (BUTTONLESSWHEEL)
1316813583 if (Math.abs(ratio) < 0.1 || Math.abs(Dtime) == 0) // < 30)
1316913584 {
1317013585 return;
....@@ -13173,7 +13588,7 @@
1317313588 boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
1317413589
1317513590 // TIMER
13176
- if (!wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR
13591
+ if (ZOOMBOXMODE && !wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR
1317713592 {
1317813593 keepboxmode = BOXMODE;
1317913594 keepsupport = SUPPORT;
....@@ -13213,8 +13628,8 @@
1321313628 // mode |= META;
1321413629 //}
1321513630
13216
- SetMouseMode(WHEEL | e.getModifiersEx());
13217
- drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0);
13631
+ SetMouseMode(e.getModifiers(), WHEEL | e.getModifiersEx());
13632
+ drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0, 0);
1321813633 anchorX = ax;
1321913634 anchorY = ay;
1322013635 prevX = px;
....@@ -13274,6 +13689,10 @@
1327413689 // wasliveok = true;
1327513690 // waslive = false;
1327613691
13692
+ // May 2019 Forget it:
13693
+ if (true)
13694
+ return;
13695
+
1327713696 // source == timer
1327813697 if (mouseDown)
1327913698 {
....@@ -13312,7 +13731,7 @@
1331213731
1331313732 javax.swing.Timer timer = new javax.swing.Timer(350, this);
1331413733
13315
- void clickStart(int x, int y, int modifiers)
13734
+ void clickStart(int x, int y, int modifiers, int modifiersex)
1331613735 {
1331713736 if (!wasliveok)
1331813737 return;
....@@ -13329,7 +13748,7 @@
1332913748 // touched = true; // main DL
1333013749 if (isRenderer)
1333113750 {
13332
- SetMouseMode(modifiers);
13751
+ SetMouseMode(modifiers, modifiersex);
1333313752 }
1333413753
1333513754 selectX = anchorX = x;
....@@ -13342,7 +13761,7 @@
1334213761 clicked = true;
1334313762 hold = false;
1334413763
13345
- if (((modifiers & ~1024) & ~0) == 0) // Single or multiple selection
13764
+ if (((modifiersex & ~1024) & ~0) == 0) // Single or multiple selection
1334613765 // june 2013 means CTRL_CLICK: if (((modifiers & ~1024) & ~128) == 0) // Single or multiple selection
1334713766 {
1334813767 // System.out.println("RESTART II " + modifiers);
....@@ -13373,7 +13792,7 @@
1337313792 info.camera = renderCamera;
1337413793 info.x = x;
1337513794 info.y = y;
13376
- info.modifiers = modifiers;
13795
+ info.modifiers = modifiersex;
1337713796 editObj = object.doEditClick(info, 0);
1337813797 if (!editObj)
1337913798 {
....@@ -13390,11 +13809,11 @@
1339013809
1339113810 public void mouseDragged(MouseEvent e)
1339213811 {
13812
+ //System.out.println("mouseDragged: " + e);
1339313813 if (isRenderer)
1339413814 movingcamera = true;
1339513815 //if (drawing)
1339613816 //return;
13397
- //System.out.println("mouseDragged: " + e);
1339813817 if ((e.getModifiersEx() & CTRL) != 0
1339913818 || (e.getModifiersEx() & COMMAND) != 0) // || IsFrozen())
1340013819 {
....@@ -13402,7 +13821,7 @@
1340213821 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
1340313822 }
1340413823 else
13405
- drag(e.getX(), e.getY(), e.getModifiersEx());
13824
+ drag(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx());
1340613825
1340713826 //try { Thread.sleep(1); } catch (Exception ex) {}
1340813827 }
....@@ -13575,6 +13994,7 @@
1357513994
1357613995 public void run()
1357713996 {
13997
+ new Exception().printStackTrace();
1357813998 System.exit(0);
1357913999 for (;;)
1358014000 {
....@@ -13638,7 +14058,7 @@
1363814058 {
1363914059 Globals.lighttouched = true;
1364014060 }
13641
- drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS);
14061
+ drag(X, (mouseMode != 0) ? Y : anchorY, 0, MODIFIERS);
1364214062 }
1364314063 //else
1364414064 }
....@@ -13738,7 +14158,7 @@
1373814158 int X, Y;
1373914159 boolean SX, SY;
1374014160
13741
- void drag(int x, int y, int modifiers)
14161
+ void drag(int x, int y, int modifiers, int modifiersex)
1374214162 {
1374314163 if (IsFrozen())
1374414164 {
....@@ -13747,17 +14167,17 @@
1374714167
1374814168 drag = true; // NEW
1374914169
13750
- boolean continuous = (modifiers & COMMAND) == COMMAND;
14170
+ boolean continuous = (modifiersex & COMMAND) == COMMAND;
1375114171
1375214172 X = x;
1375314173 Y = y;
1375414174 // floating state for animation
13755
- MODIFIERS = modifiers;
13756
- modifiers &= ~1024;
14175
+ MODIFIERS = modifiersex;
14176
+ modifiersex &= ~1024;
1375714177 if (false) // modifiers != 0)
1375814178 {
1375914179 //new Exception().printStackTrace();
13760
- System.out.println("mouseDragged: " + modifiers);
14180
+ System.out.println("mouseDragged: " + modifiersex);
1376114181 System.out.println("SHIFT = " + SHIFT);
1376214182 System.out.println("CONTROL = " + COMMAND);
1376314183 System.out.println("META = " + META);
....@@ -13777,7 +14197,7 @@
1377714197 info.camera = renderCamera;
1377814198 info.x = x;
1377914199 info.y = y;
13780
- object.editWindow.copy.doEditDrag(info);
14200
+ object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
1378114201 } else
1378214202 {
1378314203 if (x < startX)
....@@ -13929,7 +14349,6 @@
1392914349 public void mouseMoved(MouseEvent e)
1393014350 {
1393114351 //System.out.println("mouseMoved: " + e);
13932
-
1393314352 if (isRenderer)
1393414353 return;
1393514354
....@@ -13955,6 +14374,7 @@
1395514374 public void mouseReleased(MouseEvent e)
1395614375 {
1395714376 movingcamera = false;
14377
+ X = Y = 0;
1395814378 //System.out.println("mouseReleased: " + e);
1395914379 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
1396014380 }
....@@ -13977,9 +14397,9 @@
1397714397 boolean control = ((modifiers & CTRL) != 0); // june 2013: for point selection
1397814398 boolean command = ((modifiers & COMMAND) != 0); // june 2013: for multiple selection
1397914399
13980
- if (control || command || IsFrozen())
14400
+// No delay if (control || command || IsFrozen())
1398114401 timeout = true;
13982
- else
14402
+// ?? May 2019 else
1398314403 // timer.setDelay((modifiers & 128) != 0?0:350);
1398414404 mouseDown = false;
1398514405 if (!control && !command) // june 2013
....@@ -14089,7 +14509,7 @@
1408914509 System.out.println("keyReleased: " + e);
1409014510 }
1409114511
14092
- void SetMouseMode(int modifiers)
14512
+ void SetMouseMode(int modifiers, int modifiersex)
1409314513 {
1409414514 //System.out.println("SetMouseMode = " + modifiers);
1409514515 //modifiers &= ~1024;
....@@ -14101,25 +14521,25 @@
1410114521 //if (modifiers == 0) // || (modifiers == (1024 | CONTROL)))
1410214522 // return;
1410314523 //System.out.println("SetMode = " + modifiers);
14104
- if ((modifiers & WHEEL) == WHEEL)
14524
+ if ((modifiersex & WHEEL) == WHEEL)
1410514525 {
1410614526 mouseMode |= ZOOM;
1410714527 }
1410814528
1410914529 boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
14110
- if (capsLocked || (modifiers & META) == META)
14530
+ if (capsLocked) // || (modifiers & META) == META)
1411114531 {
1411214532 mouseMode |= VR; // BACKFORTH;
1411314533 }
14114
- if ((modifiers & CTRLCLICK) == CTRLCLICK)
14534
+ if ((modifiersex & CTRLCLICK) == CTRLCLICK)
1411514535 {
1411614536 mouseMode |= SELECT;
1411714537 }
14118
- if ((modifiers & COMMAND) == COMMAND)
14538
+ if ((modifiersex & COMMAND) == COMMAND)
1411914539 {
1412014540 mouseMode |= SELECT;
1412114541 }
14122
- if ((modifiers & SHIFT) == SHIFT || forcetranslate)
14542
+ if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0)
1412314543 {
1412414544 mouseMode &= ~VR;
1412514545 mouseMode |= TRANSLATE;
....@@ -14148,7 +14568,7 @@
1414814568
1414914569 if (isRenderer) //
1415014570 {
14151
- SetMouseMode(modifiers);
14571
+ SetMouseMode(0, modifiers);
1415214572 }
1415314573
1415414574 Globals.theRenderer.keyPressed(key);
....@@ -14484,7 +14904,7 @@
1448414904 //RESIZETEXTURE ^= true;
1448514905 //break;
1448614906 case 'z':
14487
- RENDERSHADOW ^= true;
14907
+ Globals.RENDERSHADOW ^= true;
1448814908 Globals.lighttouched = true;
1448914909 repaint();
1449014910 break;
....@@ -14608,7 +15028,7 @@
1460815028 //mode = ROTATE;
1460915029 if ((MODIFIERS & COMMAND) == 0) // VR??
1461015030 {
14611
- SetMouseMode(modifiers);
15031
+ SetMouseMode(0, modifiers);
1461215032 }
1461315033 }
1461415034
....@@ -14742,8 +15162,9 @@
1474215162
1474315163 protected void processMouseMotionEvent(MouseEvent e)
1474415164 {
14745
- //System.out.println("processMouseMotionEvent: " + mouseMode);
14746
- if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0)
15165
+ //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton());
15166
+ //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0)
15167
+ if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (e.getModifiers() & MouseEvent.BUTTON3_MASK) == 0 && (mouseMode & SELECT) == 0)
1474715168 {
1474815169 mouseMoved(e);
1474915170 } else
....@@ -14773,6 +15194,7 @@
1477315194
1477415195 void SelectParent()
1477515196 {
15197
+ new Exception().printStackTrace();
1477615198 System.exit(0);
1477715199 Composite group = (Composite) object;
1477815200 java.util.Vector selectees = new java.util.Vector(group.selection);
....@@ -14796,6 +15218,7 @@
1479615218
1479715219 void SelectChildren()
1479815220 {
15221
+ new Exception().printStackTrace();
1479915222 System.exit(0);
1480015223 /*
1480115224 Composite group = (Composite) object;
....@@ -14960,7 +15383,9 @@
1496015383 info.bounds.setBounds(0, 0, (int) (width * zoom), (int) (height * zoom));
1496115384 //Image img = CreateImage(width, height);
1496215385 //System.out.println("width = " + width + "; height = " + height + "\n");
15386
+
1496315387 Graphics gr = g; // img.getGraphics();
15388
+
1496415389 if (!hasMarquee)
1496515390 {
1496615391 if (Xmin < Xmax) // !locked)
....@@ -15058,14 +15483,28 @@
1505815483 if (!isRenderer)
1505915484 {
1506015485 object.drawEditHandles(info, 0);
15486
+
15487
+ if (drag && (X != 0 || Y != 0) && object.selection.Size() > 0)
15488
+ {
15489
+ switch (object.selection.get(0).hitSomething)
15490
+ {
15491
+ case Object3D.hitCenter: gr.setColor(Color.pink); break;
15492
+ case Object3D.hitRotate: gr.setColor(Color.green); break;
15493
+ case Object3D.hitScale: gr.setColor(Color.cyan); break;
15494
+ }
15495
+
15496
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15497
+ }
1506115498 }
1506215499 }
15500
+
1506315501 if (isRenderer)
1506415502 {
1506515503 //gr.setColor(Color.black);
1506615504 //gr.drawRect(info.bounds.x - 1, info.bounds.y - 1, info.bounds.width + 1, info.bounds.height + 1);
1506715505 //gr.drawRect(info.bounds.x - 2, info.bounds.y - 2, info.bounds.width + 3, info.bounds.height + 3);
1506815506 }
15507
+
1506915508 if (hasMarquee)
1507015509 {
1507115510 gr.setXORMode(Color.white);
....@@ -15178,6 +15617,7 @@
1517815617 public boolean mouseDown(Event evt, int x, int y)
1517915618 {
1518015619 System.out.println("mouseDown: " + evt);
15620
+ System.exit(0);
1518115621 /*
1518215622 locked = true;
1518315623 drag = false;
....@@ -15221,7 +15661,7 @@
1522115661 {
1522215662 keyPressed(0, modifiers);
1522315663 }
15224
- clickStart(x, y, modifiers);
15664
+ // clickStart(x, y, modifiers);
1522515665 return true;
1522615666 }
1522715667
....@@ -15339,7 +15779,7 @@
1533915779 {
1534015780 keyReleased(0, 0);
1534115781 }
15342
- drag(x, y, modifiers);
15782
+ drag(x, y, 0, modifiers);
1534315783 return true;
1534415784 }
1534515785
....@@ -15909,6 +16349,7 @@
1590916349 {
1591016350 if (!selection)
1591116351 {
16352
+ new Exception().printStackTrace();
1591216353 System.exit(0);
1591316354 return;
1591416355 }
....@@ -16036,16 +16477,16 @@
1603616477 System.out.println("; fromto " + sel + " " + Trunk(previousselectedpoint.toParent[3][0]) + " " + Trunk(previousselectedpoint.toParent[3][2]) + " " + Trunk(selectedpoint.toParent[3][0]) + " " + Trunk(selectedpoint.toParent[3][2]));
1603716478 }
1603816479
16039
- previousselectedpoint = (Sphere) GrafreeD.clone(selectedpoint);
16480
+ previousselectedpoint = (Sphere) Grafreed.clone(selectedpoint);
1604016481 }
1604116482 }
1604216483
1604316484 if (!movingcamera && !PAINTMODE)
1604416485 object.editWindow.ScreenFitPoint(); // fev 2014
1604516486
16046
- if (PAINTMODE && GrafreeD.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0)
16487
+ if (PAINTMODE && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0)
1604716488 {
16048
- Object3D paintobj = GrafreeD.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0);
16489
+ Object3D paintobj = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0);
1604916490
1605016491 Object3D group = new Object3D("inst" + paintcount++);
1605116492
....@@ -16201,7 +16642,7 @@
1620116642 gl.glDisable(gl.GL_CULL_FACE);
1620216643 }
1620316644
16204
- if (!RENDERSHADOW)
16645
+ if (!Globals.RENDERSHADOW)
1620516646 gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
1620616647
1620716648 // SB gl.glPolygonOffset(2.5f, 10);
....@@ -16211,7 +16652,7 @@
1621116652 //gl.glColorMask(false, false, false, false);
1621216653
1621316654 //render_scene_from_light_view(gl, drawable, 0, 0);
16214
- if (RENDERSHADOW && Globals.lighttouched && !movingcamera) // && !parent.IsFreezed())
16655
+ if (Globals.RENDERSHADOW && Globals.lighttouched && (!movingcamera || !Globals.FREEZEONMOVE)) // && !parent.IsFreezed())
1621516656 {
1621616657 gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
1621716658
....@@ -16695,10 +17136,11 @@
1669517136 static IntBuffer textbuffer = null; // IntBuffer.allocate(TEXT_WIDTH*8*8 * TEXT_HEIGHT);
1669617137 // Depth buffer format
1669717138 //private int depth_format;
16698
- static public void NextIndex(Object3D o, GL gl)
17139
+
17140
+ public void NextIndex()
1669917141 {
1670017142 indexcount+=16;
16701
- gl.glColor3d(((indexcount >>> 16) & 255) / 255.0, ((indexcount >>> 8) & 255) / 255.0, ((indexcount) & 255) / 255.0);
17143
+ GetGL().glColor3d(((indexcount >>> 16) & 255) / 255.0, ((indexcount >>> 8) & 255) / 255.0, ((indexcount) & 255) / 255.0);
1670217144 //objects[indexcount] = o;
1670317145 //System.out.println("indexcount = " + indexcount);
1670417146 }