.. | .. |
---|
31 | 31 | |
---|
32 | 32 | import gleem.linalg.Mat4f; |
---|
33 | 33 | |
---|
34 | | -class CameraPane extends GLCanvas implements Runnable, GLEventListener, ActionListener, MouseWheelListener, MouseMotionListener, MouseListener, KeyListener |
---|
| 34 | +class CameraPane extends GLCanvas implements iCameraPane, Runnable, GLEventListener, ActionListener, MouseWheelListener, MouseMotionListener, MouseListener, KeyListener |
---|
35 | 35 | { |
---|
| 36 | + static cMaterial[] materialstack = new cMaterial[65536]; |
---|
| 37 | + static boolean[] selectedstack = new boolean[65536]; |
---|
| 38 | + static int materialdepth = 0; |
---|
| 39 | + |
---|
36 | 40 | static boolean DEBUG = false; |
---|
37 | 41 | static boolean FRUSTUM = false; // still bogus true; // frustum culling |
---|
38 | 42 | |
---|
.. | .. |
---|
42 | 46 | |
---|
43 | 47 | static int STEP = 1; |
---|
44 | 48 | |
---|
45 | | - static boolean ONESTEP = false; // do LIVE once |
---|
46 | | - |
---|
47 | | - /** |
---|
48 | | - * @return the LIVE |
---|
49 | | - */ |
---|
50 | | - public static boolean isLIVE() |
---|
51 | | - { |
---|
52 | | - return LIVE || ONESTEP; |
---|
53 | | - } |
---|
54 | | - |
---|
55 | | - /** |
---|
56 | | - * @param aLIVE the LIVE to set |
---|
57 | | - */ |
---|
58 | | - public static void setLIVE(boolean aLIVE) |
---|
59 | | - { |
---|
60 | | - LIVE = aLIVE; |
---|
61 | | - } |
---|
62 | | - |
---|
63 | | - /*static*/ boolean CULLFACE = false; // true; |
---|
| 49 | + /*static*/ private boolean CULLFACE = false; // true; |
---|
64 | 50 | /*static*/ boolean NEAREST = false; // true; |
---|
65 | 51 | /*static*/ boolean WIREFRAME = false; // true; |
---|
66 | 52 | |
---|
.. | .. |
---|
97 | 83 | |
---|
98 | 84 | static boolean textureon = true; |
---|
99 | 85 | static boolean LOCALTRANSFORM = false; |
---|
100 | | -private static boolean LIVE = false; |
---|
101 | 86 | static boolean FULLSCREEN = false; |
---|
102 | 87 | static boolean SUPPORT = true; |
---|
103 | | -static boolean CROWD = false; |
---|
104 | 88 | static boolean INERTIA = true; |
---|
105 | 89 | static boolean FAST = false; |
---|
106 | 90 | static boolean SLOWPOSE = false; |
---|
.. | .. |
---|
165 | 149 | defaultcaps.setAccumBlueBits(16); |
---|
166 | 150 | defaultcaps.setAccumAlphaBits(16); |
---|
167 | 151 | } |
---|
| 152 | + |
---|
168 | 153 | static CameraPane theRenderer; |
---|
169 | | - |
---|
| 154 | + |
---|
170 | 155 | void SetAsGLRenderer(boolean b) |
---|
171 | 156 | { |
---|
172 | 157 | isRenderer = b; |
---|
173 | 158 | theRenderer = this; |
---|
| 159 | + } |
---|
| 160 | + |
---|
| 161 | + CameraPane(Object3D o, Camera cam, boolean withcontext) |
---|
| 162 | + { |
---|
| 163 | + super(defaultcaps, null, withcontext?glcontext:null, null); |
---|
| 164 | + |
---|
| 165 | + //System.out.println("AMERICA AREA = " + (9458886 + 9210755 + 8480395 + 2736391 + 1943018 + 1289475 + 1141569 + 1069350 + 911559 + 721229 + 395886 + 377972 + 246700 + 211156 + 173985 + 141133 + 118279 + 112079 + 108523)); |
---|
| 166 | + glcontext = getContext(); |
---|
| 167 | + |
---|
| 168 | + cameras = new Camera[2]; |
---|
| 169 | + targetLookAts = new cVector[2]; |
---|
| 170 | + |
---|
| 171 | + SetCamera(cam); |
---|
| 172 | + |
---|
| 173 | + SetLight(new Camera(new cVector(10, 10, -20))); |
---|
| 174 | + |
---|
| 175 | + object = o; |
---|
| 176 | + |
---|
| 177 | + setBackground(Color.white); |
---|
| 178 | + |
---|
| 179 | + addKeyListener(this); |
---|
| 180 | + addMouseListener(this); |
---|
| 181 | + addMouseMotionListener(this); |
---|
| 182 | + addMouseWheelListener(this); |
---|
| 183 | + //System.out.println("addGLEventListener: " + this); |
---|
| 184 | + addGLEventListener(this); |
---|
| 185 | + |
---|
| 186 | +// pingthread.start(); // may 2013 |
---|
174 | 187 | } |
---|
175 | 188 | |
---|
176 | 189 | static boolean AntialiasingEnabled() |
---|
.. | .. |
---|
178 | 191 | return CURRENTANTIALIAS > 0; |
---|
179 | 192 | } |
---|
180 | 193 | |
---|
181 | | - void ClearDepth() |
---|
| 194 | + /// INTERFACE |
---|
| 195 | + |
---|
| 196 | + public boolean IsBoxMode() |
---|
| 197 | + { |
---|
| 198 | + return BOXMODE; |
---|
| 199 | + } |
---|
| 200 | + |
---|
| 201 | + public void ClearDepth() |
---|
182 | 202 | { |
---|
183 | 203 | GetGL().glClear(GetGL().GL_DEPTH_BUFFER_BIT); |
---|
184 | 204 | } |
---|
185 | 205 | |
---|
186 | | - void DepthTest(boolean depthtest) |
---|
| 206 | + public void DepthTest(boolean depthtest) |
---|
187 | 207 | { |
---|
188 | 208 | if (depthtest) |
---|
189 | 209 | GetGL().glDepthFunc(GL.GL_LEQUAL); |
---|
.. | .. |
---|
191 | 211 | GetGL().glDepthFunc(GL.GL_ALWAYS); |
---|
192 | 212 | } |
---|
193 | 213 | |
---|
194 | | - void DepthWrite(boolean depthwrite) |
---|
| 214 | + public void DepthWrite(boolean depthwrite) |
---|
195 | 215 | { |
---|
196 | 216 | if (depthwrite) |
---|
197 | 217 | GetGL().glDepthMask(true); |
---|
.. | .. |
---|
199 | 219 | GetGL().glDepthMask(false); |
---|
200 | 220 | } |
---|
201 | 221 | |
---|
202 | | - void BackFaceCull(boolean bfc) |
---|
| 222 | + public void BackFaceCull(boolean bfc) |
---|
203 | 223 | { |
---|
204 | 224 | if (bfc) |
---|
205 | 225 | GetGL().glEnable(GetGL().GL_CULL_FACE); |
---|
206 | 226 | else |
---|
207 | 227 | GetGL().glDisable(GetGL().GL_CULL_FACE); |
---|
| 228 | + } |
---|
| 229 | + |
---|
| 230 | + public boolean BackFaceCullMode() |
---|
| 231 | + { |
---|
| 232 | + return this.CULLFACE; |
---|
| 233 | + } |
---|
| 234 | + |
---|
| 235 | + public boolean IsAmbientOcclusionOn() |
---|
| 236 | + { |
---|
| 237 | + return this.ambientOcclusion; |
---|
| 238 | + } |
---|
| 239 | + |
---|
| 240 | + public boolean IsDebugSelection() |
---|
| 241 | + { |
---|
| 242 | + return DEBUG_SELECTION; |
---|
| 243 | + } |
---|
| 244 | + |
---|
| 245 | + public boolean IsFrozen() |
---|
| 246 | + { |
---|
| 247 | + boolean selectmode = this.DrawMode() == SELECTION || this.IsDebugSelection(); |
---|
| 248 | + |
---|
| 249 | + return !selectmode && cameracount == 0; // != 0; |
---|
| 250 | + } |
---|
| 251 | + |
---|
| 252 | + // Currently in Globals |
---|
| 253 | + public int DrawMode() |
---|
| 254 | + { |
---|
| 255 | + return Globals.DrawMode(); |
---|
| 256 | + } |
---|
| 257 | + |
---|
| 258 | + public Camera EyeCamera() |
---|
| 259 | + { |
---|
| 260 | + return eyeCamera; |
---|
| 261 | + } |
---|
| 262 | + |
---|
| 263 | + public Camera LightCamera() |
---|
| 264 | + { |
---|
| 265 | + return lightCamera; |
---|
| 266 | + } |
---|
| 267 | + |
---|
| 268 | + public Camera ManipCamera() |
---|
| 269 | + { |
---|
| 270 | + return manipCamera; |
---|
| 271 | + } |
---|
| 272 | + |
---|
| 273 | + public Camera RenderCamera() |
---|
| 274 | + { |
---|
| 275 | + return renderCamera; |
---|
| 276 | + } |
---|
| 277 | + |
---|
| 278 | + public Camera[] Cameras() |
---|
| 279 | + { |
---|
| 280 | + return cameras; |
---|
| 281 | + } |
---|
| 282 | + |
---|
| 283 | + public void PushMaterial(Object3D obj, boolean selected) |
---|
| 284 | + { |
---|
| 285 | + CameraPane display = this; |
---|
| 286 | + javax.media.opengl.GL gl = display.GetGL(); |
---|
| 287 | + cMaterial material = obj.material; |
---|
| 288 | + |
---|
| 289 | + if (material != null) |
---|
| 290 | + { |
---|
| 291 | + materialstack[materialdepth] = material; |
---|
| 292 | + selectedstack[materialdepth] = selected; |
---|
| 293 | + cStatic.objectstack[materialdepth++] = obj; |
---|
| 294 | + //System.out.println("material " + material); |
---|
| 295 | + //Applet3D.tracein(this, selected); |
---|
| 296 | + display.vector2buffer = obj.projectedVertices; |
---|
| 297 | + if (obj instanceof Camera) |
---|
| 298 | + { |
---|
| 299 | + display.options1[0] = material.shift; |
---|
| 300 | + //System.out.println("shift " + material.shift); |
---|
| 301 | + display.options1[1] = material.lightarea; |
---|
| 302 | + display.options1[2] = material.shadowbias; |
---|
| 303 | + display.options1[3] = material.aniso; |
---|
| 304 | + display.options1[4] = material.anisoV; |
---|
| 305 | + display.options2[0] = material.opacity; |
---|
| 306 | + display.options2[1] = material.diffuse; |
---|
| 307 | + display.options2[2] = material.factor; |
---|
| 308 | + |
---|
| 309 | + cColor.HSBtoRGB(material.color, material.modulation, 1, display.options3); |
---|
| 310 | + display.options4[0] = material.cameralight/0.2f; |
---|
| 311 | + display.options4[1] = material.subsurface; |
---|
| 312 | + display.options4[2] = material.sheen; |
---|
| 313 | + |
---|
| 314 | + // if (display.CURRENTANTIALIAS > 0) |
---|
| 315 | + // display.options3[3] /= 4; |
---|
| 316 | + |
---|
| 317 | + /* |
---|
| 318 | + System.out.println("Focus = " + display.options1[0]); |
---|
| 319 | + System.out.println("Aperture = " + display.options1[1]); |
---|
| 320 | + System.out.println("ShadowBlur = " + display.options1[2]); |
---|
| 321 | + System.out.println("Antialiasing = " + display.options1[3]); |
---|
| 322 | + System.out.println("Fog = " + display.options2[0]); |
---|
| 323 | + System.out.println("Intensity = " + display.options2[1]); |
---|
| 324 | + System.out.println("Elevation = " + display.options2[2]); |
---|
| 325 | + /**/ |
---|
| 326 | + } else |
---|
| 327 | + { |
---|
| 328 | + DrawMaterial(material, selected); |
---|
| 329 | + } |
---|
| 330 | + } else |
---|
| 331 | + { |
---|
| 332 | + if (selected && CameraPane.flash) |
---|
| 333 | + { |
---|
| 334 | + display.modelParams4[1] = 100; |
---|
| 335 | + gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 4, display.modelParams4, 0); |
---|
| 336 | + } |
---|
| 337 | + } |
---|
| 338 | + } |
---|
| 339 | + |
---|
| 340 | + public void PushMaterial2(Object3D obj, boolean selected) |
---|
| 341 | + { |
---|
| 342 | + CameraPane display = this; |
---|
| 343 | + cMaterial material = obj.material; |
---|
| 344 | + |
---|
| 345 | + if (material != null) |
---|
| 346 | + { |
---|
| 347 | + materialstack[materialdepth] = material; |
---|
| 348 | + selectedstack[materialdepth] = selected; |
---|
| 349 | + cStatic.objectstack[materialdepth++] = obj; |
---|
| 350 | + //System.out.println("material " + material); |
---|
| 351 | + //Applet3D.tracein("selected ", selected); |
---|
| 352 | + display.vector2buffer = obj.projectedVertices; |
---|
| 353 | + display.DrawMaterial(material, selected); |
---|
| 354 | + } |
---|
| 355 | + } |
---|
| 356 | + |
---|
| 357 | + public void PopMaterial(Object3D obj, boolean selected) |
---|
| 358 | + { |
---|
| 359 | + CameraPane display = this; |
---|
| 360 | + javax.media.opengl.GL gl = display.GetGL(); |
---|
| 361 | + cMaterial material = obj.material; |
---|
| 362 | + |
---|
| 363 | + //if (parent != null && parent.GetMaterial() != null) |
---|
| 364 | + // parent.GetMaterial().Draw(display, parent.IsSelected(this)); |
---|
| 365 | + if (material != null) |
---|
| 366 | + { |
---|
| 367 | + materialdepth -= 1; |
---|
| 368 | + if (materialdepth > 0) |
---|
| 369 | + { |
---|
| 370 | + display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
| 371 | + display.DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1]); |
---|
| 372 | + } |
---|
| 373 | + //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???"); |
---|
| 374 | + } else if (selected && CameraPane.flash && obj.GetMaterial() != null) |
---|
| 375 | + { |
---|
| 376 | + display.modelParams4[1] = obj.GetMaterial().cameralight; |
---|
| 377 | + gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 4, display.modelParams4, 0); |
---|
| 378 | + } |
---|
| 379 | + } |
---|
| 380 | + |
---|
| 381 | + public void PopMaterial2(Object3D obj) |
---|
| 382 | + { |
---|
| 383 | + CameraPane display = this; |
---|
| 384 | + cMaterial material = obj.material; |
---|
| 385 | + |
---|
| 386 | + if (material != null) |
---|
| 387 | + { |
---|
| 388 | + materialdepth -= 1; |
---|
| 389 | + if (materialdepth > 0) |
---|
| 390 | + { |
---|
| 391 | + display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
| 392 | + display.DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1]); |
---|
| 393 | + } |
---|
| 394 | + //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???"); |
---|
| 395 | + //else |
---|
| 396 | + //material.Draw(display, false); |
---|
| 397 | + } |
---|
| 398 | + } |
---|
| 399 | + |
---|
| 400 | + public void DrawFace(Object3D obj, Vertex pv, Vertex qv, Vertex rv, Face face) |
---|
| 401 | + { |
---|
| 402 | + CameraPane display = this; |
---|
| 403 | + |
---|
| 404 | + if (pv.y == -10000 || |
---|
| 405 | + qv.y == -10000 || |
---|
| 406 | + rv.y == -10000) |
---|
| 407 | + return; |
---|
| 408 | + |
---|
| 409 | +// float b = f.nbiterations & 1; |
---|
| 410 | +// float g = (f.nbiterations>>1) & 1; |
---|
| 411 | +// float r = (f.nbiterations>>2) & 1; |
---|
| 412 | +// |
---|
| 413 | +// //if (f.weight == 10000) |
---|
| 414 | +// //{ |
---|
| 415 | +// // r = 1; g = b = 0; |
---|
| 416 | +// //} |
---|
| 417 | +// //else |
---|
| 418 | +// //{ |
---|
| 419 | +// // assert(f.weight < 10000); |
---|
| 420 | +// r = g = b = (float)bRep.FaceWeight(f)*100; |
---|
| 421 | +// if (r<0) |
---|
| 422 | +// assert(r>=0); |
---|
| 423 | +// //} |
---|
| 424 | + |
---|
| 425 | + javax.media.opengl.GL gl = display.GetGL(); |
---|
| 426 | + |
---|
| 427 | + boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection(); |
---|
| 428 | + |
---|
| 429 | + //System.out.println("p = " + pv + "; q = " + qv + "; r = " + rv); |
---|
| 430 | + if (!selectmode) // display.drawMode != display.SELECTION) // && display.drawMode != display.SHADOW) // (attributes & FILL) != 0) |
---|
| 431 | + { |
---|
| 432 | + //gl.glBegin(gl.GL_TRIANGLES); |
---|
| 433 | + boolean hasnorm = pv.norm != null; // && (pv.norm.x != 0 || pv.norm.y != 0 || pv.norm.z != 0); |
---|
| 434 | + if (!hasnorm) |
---|
| 435 | + { |
---|
| 436 | + // System.out.println("FUCK!!"); |
---|
| 437 | + LA.vecSub(pv/*.pos*/, qv/*.pos*/, obj.v0); |
---|
| 438 | + LA.vecSub(pv/*.pos*/, rv/*.pos*/, obj.v1); |
---|
| 439 | + LA.vecCross(obj.v0, obj.v1, obj.v2); |
---|
| 440 | + LA.vecNormalize(obj.v2); |
---|
| 441 | + gl.glNormal3f((float) obj.v2.x, (float) obj.v2.y, (float) obj.v2.z); |
---|
| 442 | + } |
---|
| 443 | + |
---|
| 444 | + // P |
---|
| 445 | + float x = (float)pv.x; |
---|
| 446 | + float y = (float)pv.y; |
---|
| 447 | + float z = (float)pv.z; |
---|
| 448 | + |
---|
| 449 | + if (hasnorm) |
---|
| 450 | + { |
---|
| 451 | +// if (!pv.norm.normalized()) |
---|
| 452 | +// assert(pv.norm.normalized()); |
---|
| 453 | + |
---|
| 454 | + //System.out.println("normalp = " + pv.norm.x + ", " + pv.norm.y + ", " + pv.norm.z); |
---|
| 455 | + float nx = (float)pv.norm.x; |
---|
| 456 | + float ny = (float)pv.norm.y; |
---|
| 457 | + float nz = (float)pv.norm.z; |
---|
| 458 | + |
---|
| 459 | + x += nx * obj.NORMALPUSH; |
---|
| 460 | + y += ny * obj.NORMALPUSH; |
---|
| 461 | + z += nz * obj.NORMALPUSH; |
---|
| 462 | + |
---|
| 463 | + gl.glNormal3f(nx, ny, nz); |
---|
| 464 | + } |
---|
| 465 | + gl.glColor4f(pv.AO, pv.AO, pv.AO, 1); |
---|
| 466 | + SetColor(obj, pv); |
---|
| 467 | + //gl.glColor4f(r, g, b, 1); |
---|
| 468 | + //gl.glColor4f(pv.boundary, pv.boundary, pv.boundary, 1); |
---|
| 469 | + if (obj.flipV) |
---|
| 470 | + gl.glTexCoord2f((float) pv.s, 1-(float) pv.t); |
---|
| 471 | + else |
---|
| 472 | + gl.glTexCoord2f((float) pv.s, (float) pv.t); |
---|
| 473 | + //System.out.println("vertexp = " + pv.x + ", " + pv.y + ", " + pv.z); |
---|
| 474 | + |
---|
| 475 | + gl.glVertex3f(x, y, z); |
---|
| 476 | + |
---|
| 477 | + // Q |
---|
| 478 | + x = (float)qv.x; |
---|
| 479 | + y = (float)qv.y; |
---|
| 480 | + z = (float)qv.z; |
---|
| 481 | + |
---|
| 482 | +// Print(pv); |
---|
| 483 | + if (hasnorm) |
---|
| 484 | + { |
---|
| 485 | +// assert(qv.norm.normalized()); |
---|
| 486 | + //System.out.println("normalq = " + qv.norm.x + ", " + qv.norm.y + ", " + qv.norm.z); |
---|
| 487 | + float nx = (float)qv.norm.x; |
---|
| 488 | + float ny = (float)qv.norm.y; |
---|
| 489 | + float nz = (float)qv.norm.z; |
---|
| 490 | + |
---|
| 491 | + x += nx * obj.NORMALPUSH; |
---|
| 492 | + y += ny * obj.NORMALPUSH; |
---|
| 493 | + z += nz * obj.NORMALPUSH; |
---|
| 494 | + |
---|
| 495 | + gl.glNormal3f(nx, ny, nz); |
---|
| 496 | + } |
---|
| 497 | + //System.out.println("vertexq = " + qv.s + ", " + qv.t); |
---|
| 498 | + // boolean locked = false; |
---|
| 499 | + // float eps = 0.1f; |
---|
| 500 | + // boolean wrap = CameraPane.UVWRAP; // true; // UV WRAP TEXTURE ISSUE: true = artifacts, false = nice |
---|
| 501 | + |
---|
| 502 | + // int dot = 0; //*/ (int)f.dot; |
---|
| 503 | + |
---|
| 504 | + // if ((dot&1) == 0) |
---|
| 505 | + // dot |= (Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps) ? 3 : 1; |
---|
| 506 | + |
---|
| 507 | + // if (wrap || (dot&2) != 0) // Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps) |
---|
| 508 | + if (obj.flipV) |
---|
| 509 | + gl.glTexCoord2f((float) qv.s, 1-(float) qv.t); |
---|
| 510 | + else |
---|
| 511 | + gl.glTexCoord2f((float) qv.s, (float) qv.t); |
---|
| 512 | + // else |
---|
| 513 | + // { |
---|
| 514 | + // locked = true; |
---|
| 515 | + // gl.glTexCoord2f((float) pv.s, (float) pv.t); |
---|
| 516 | + // } |
---|
| 517 | + gl.glColor4f(qv.AO, qv.AO, qv.AO, 1); |
---|
| 518 | + SetColor(obj, qv); |
---|
| 519 | + |
---|
| 520 | + gl.glVertex3f(x, y, z); |
---|
| 521 | + //gl.glColor4f(r, g, b, 1); |
---|
| 522 | + //gl.glColor4f(qv.boundary, qv.boundary, qv.boundary, 1); |
---|
| 523 | + //System.out.println("vertexq = " + qv.x + ", " + qv.y + ", " + qv.z); |
---|
| 524 | +// Print(qv); |
---|
| 525 | + |
---|
| 526 | + // R |
---|
| 527 | + x = (float)rv.x; |
---|
| 528 | + y = (float)rv.y; |
---|
| 529 | + z = (float)rv.z; |
---|
| 530 | + |
---|
| 531 | + if (hasnorm) |
---|
| 532 | + { |
---|
| 533 | +// assert(rv.norm.normalized()); |
---|
| 534 | + //System.out.println("normalr = " + rv.norm.x + ", " + rv.norm.y + ", " + rv.norm.z); |
---|
| 535 | + float nx = (float)rv.norm.x; |
---|
| 536 | + float ny = (float)rv.norm.y; |
---|
| 537 | + float nz = (float)rv.norm.z; |
---|
| 538 | + |
---|
| 539 | + x += nx * obj.NORMALPUSH; |
---|
| 540 | + y += ny * obj.NORMALPUSH; |
---|
| 541 | + z += nz * obj.NORMALPUSH; |
---|
| 542 | + |
---|
| 543 | + gl.glNormal3f(nx, ny, nz); |
---|
| 544 | + } |
---|
| 545 | + |
---|
| 546 | + // if ((dot&4) == 0) |
---|
| 547 | + // dot |= (Math.abs(rv.s - pv.s) < eps && Math.abs(rv.t - pv.t) < eps) ? 12 : 4; |
---|
| 548 | + |
---|
| 549 | + // if (wrap || !locked && (dot&8) != 0) |
---|
| 550 | + if (obj.flipV) |
---|
| 551 | + gl.glTexCoord2f((float) rv.s, 1-(float) rv.t); |
---|
| 552 | + else |
---|
| 553 | + gl.glTexCoord2f((float) rv.s, (float) rv.t); |
---|
| 554 | + // else |
---|
| 555 | + // gl.glTexCoord2f((float) pv.s, (float) pv.t); |
---|
| 556 | + |
---|
| 557 | + // f.dot = dot; |
---|
| 558 | + |
---|
| 559 | + gl.glColor4f(rv.AO, rv.AO, rv.AO, 1); |
---|
| 560 | + SetColor(obj, rv); |
---|
| 561 | + //gl.glColor4f(r, g, b, 1); |
---|
| 562 | + //gl.glColor4f(rv.boundary, rv.boundary, rv.boundary, 1); |
---|
| 563 | + //System.out.println("vertexr = " + rv.x + ", " + rv.y + ", " + rv.z); |
---|
| 564 | + gl.glVertex3f(x, y, z); |
---|
| 565 | +// Print(rv); |
---|
| 566 | + //gl.glEnd(); |
---|
| 567 | + } |
---|
| 568 | + else |
---|
| 569 | + { |
---|
| 570 | + gl.glVertex3f((float) pv.x, (float) pv.y, (float) pv.z); |
---|
| 571 | + gl.glVertex3f((float) qv.x, (float) qv.y, (float) qv.z); |
---|
| 572 | + gl.glVertex3f((float) rv.x, (float) rv.y, (float) rv.z); |
---|
| 573 | + |
---|
| 574 | + } |
---|
| 575 | + |
---|
| 576 | + if (false) // (attributes & WIREFRAME) != 0) |
---|
| 577 | + { |
---|
| 578 | + gl.glDisable(gl.GL_LIGHTING); |
---|
| 579 | + |
---|
| 580 | + gl.glBegin(gl.GL_LINE_LOOP); |
---|
| 581 | + gl.glVertex3d(pv./*pos.*/x, pv./*pos.*/y, pv./*pos.*/z); |
---|
| 582 | + gl.glVertex3d(qv./*pos.*/x, qv./*pos.*/y, qv./*pos.*/z); |
---|
| 583 | + gl.glVertex3d(rv./*pos.*/x, rv./*pos.*/y, rv./*pos.*/z); |
---|
| 584 | + gl.glEnd(); |
---|
| 585 | + |
---|
| 586 | + gl.glEnable(gl.GL_LIGHTING); |
---|
| 587 | + } |
---|
| 588 | + } |
---|
| 589 | + |
---|
| 590 | + /** |
---|
| 591 | + * <code>draw</code> renders a <code>TriMesh</code> object including |
---|
| 592 | + * it's normals, colors, textures and vertices. |
---|
| 593 | + * |
---|
| 594 | + * @see Renderer#draw(TriMesh) |
---|
| 595 | + * @param tris |
---|
| 596 | + * the mesh to render. |
---|
| 597 | + */ |
---|
| 598 | + public void DrawParticles(TriMesh geo, Object3D shape, boolean selected, boolean rotate) // TriMesh tris) |
---|
| 599 | + { |
---|
| 600 | + CameraPane display = this; |
---|
| 601 | + |
---|
| 602 | + float r = display.modelParams0[0]; |
---|
| 603 | + float g = display.modelParams0[1]; |
---|
| 604 | + float b = display.modelParams0[2]; |
---|
| 605 | + float opacity = display.modelParams5[1]; |
---|
| 606 | + |
---|
| 607 | + //final GL gl = GLU.getCurrentGL(); |
---|
| 608 | + GL gl = display.GetGL(); // getGL(); |
---|
| 609 | + |
---|
| 610 | + FloatBuffer vertBuf = geo.vertBuf; |
---|
| 611 | + |
---|
| 612 | + int v = vertBuf.capacity(); |
---|
| 613 | + |
---|
| 614 | + int count = 0; |
---|
| 615 | + |
---|
| 616 | + boolean cf = gl.glIsEnabled(gl.GL_CULL_FACE); |
---|
| 617 | + gl.glEnable(gl.GL_CULL_FACE); |
---|
| 618 | + // gl.glScalef(1.0f/1024,1.0f/1024,1.0f/1024); |
---|
| 619 | + for (int i=0; i<v/3; i++) |
---|
| 620 | + { |
---|
| 621 | + int index3 = i*3; |
---|
| 622 | + |
---|
| 623 | + if (geo.sizeBuf.get(index3+1) == 0) |
---|
| 624 | + continue; |
---|
| 625 | + |
---|
| 626 | + count++; |
---|
| 627 | + |
---|
| 628 | + int index4 = i*4; |
---|
| 629 | + |
---|
| 630 | + float tx = vertBuf.get(index3); |
---|
| 631 | + float ty = vertBuf.get(index3+1); |
---|
| 632 | + float tz = vertBuf.get(index3+2); |
---|
| 633 | + |
---|
| 634 | + // if (tx == 0 && ty == 0 && tz == 0) |
---|
| 635 | + // continue; |
---|
| 636 | + |
---|
| 637 | + gl.glMatrixMode(gl.GL_TEXTURE); |
---|
| 638 | + gl.glPushMatrix(); |
---|
| 639 | + |
---|
| 640 | + float[] texmat = geo.texmat; |
---|
| 641 | + texmat[12] = texmat[13] = texmat[14] = i; |
---|
| 642 | + |
---|
| 643 | + gl.glMultMatrixf(texmat, 0); |
---|
| 644 | + |
---|
| 645 | + gl.glMatrixMode(gl.GL_MODELVIEW); |
---|
| 646 | + gl.glPushMatrix(); |
---|
| 647 | + |
---|
| 648 | + gl.glTranslatef(tx,ty,tz); |
---|
| 649 | + |
---|
| 650 | + if (rotate) |
---|
| 651 | + gl.glRotatef(i, 0, 1, 0); |
---|
| 652 | + |
---|
| 653 | + float size = geo.sizeBuf.get(index3) / 100; |
---|
| 654 | + gl.glScalef(size,size,size); |
---|
| 655 | + |
---|
| 656 | + float cr = geo.colorBuf.get(index4); |
---|
| 657 | + float cg = geo.colorBuf.get(index4+1); |
---|
| 658 | + float cb = geo.colorBuf.get(index4+2); |
---|
| 659 | + float ca = geo.colorBuf.get(index4+3); |
---|
| 660 | + |
---|
| 661 | + display.modelParams0[0] = r * cr; |
---|
| 662 | + display.modelParams0[1] = g * cg; |
---|
| 663 | + display.modelParams0[2] = b * cb; |
---|
| 664 | + |
---|
| 665 | + display.modelParams5[1] = opacity * ca; |
---|
| 666 | + |
---|
| 667 | + gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 0, display.modelParams0, 0); |
---|
| 668 | + gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 5, display.modelParams5, 0); |
---|
| 669 | + |
---|
| 670 | + RandomNode.globalseed = (int)geo.sizeBuf.get(index3+2); // i; |
---|
| 671 | + RandomNode.globalseed2 = RandomNode.globalseed; |
---|
| 672 | + |
---|
| 673 | +// gl.glColor4f(cr,cg,cb,ca); |
---|
| 674 | + // gl.glScalef(1024/16,1024/16,1024/16); |
---|
| 675 | + shape.Draw/*Node*/(display,null,selected,false); // blocked |
---|
| 676 | + // gl.glScalef(16.0f/1024,16.0f/1024,16.0f/1024); |
---|
| 677 | + //gl.glTranslatef(-tx,-ty,-tz); |
---|
| 678 | + gl.glPopMatrix(); |
---|
| 679 | + |
---|
| 680 | + gl.glMatrixMode(gl.GL_TEXTURE); |
---|
| 681 | + gl.glPopMatrix(); |
---|
| 682 | + } |
---|
| 683 | + // gl.glScalef(1024,1024,1024); |
---|
| 684 | + if (!cf) |
---|
| 685 | + gl.glDisable(gl.GL_CULL_FACE); |
---|
| 686 | + |
---|
| 687 | + display.modelParams0[0] = r; |
---|
| 688 | + display.modelParams0[1] = g; |
---|
| 689 | + display.modelParams0[2] = b; |
---|
| 690 | + |
---|
| 691 | + display.modelParams5[1] = opacity; |
---|
| 692 | + |
---|
| 693 | + gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 0, display.modelParams0, 0); |
---|
| 694 | + gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 5, display.modelParams5, 0); |
---|
| 695 | + |
---|
| 696 | + gl.glMatrixMode(gl.GL_MODELVIEW); |
---|
| 697 | + |
---|
| 698 | +// System.err.println("total = " + v/3 + "; displayed = " + count); |
---|
| 699 | + if (true) |
---|
| 700 | + return; |
---|
| 701 | + |
---|
| 702 | +//// if (!tris.predraw(this)) |
---|
| 703 | +//// { |
---|
| 704 | +//// return; |
---|
| 705 | +//// } |
---|
| 706 | +//// if (Debug.stats) |
---|
| 707 | +//// { |
---|
| 708 | +//// StatCollector.addStat(StatType.STAT_TRIANGLE_COUNT, tris.getTriangleCount()); |
---|
| 709 | +//// StatCollector.addStat(StatType.STAT_VERTEX_COUNT, tris.getVertexCount()); |
---|
| 710 | +//// StatCollector.addStat(StatType.STAT_GEOM_COUNT, 1); |
---|
| 711 | +//// } |
---|
| 712 | +//// |
---|
| 713 | +//// if (tris.getDisplayListID() != -1) |
---|
| 714 | +//// { |
---|
| 715 | +//// renderDisplayList(tris); |
---|
| 716 | +//// return; |
---|
| 717 | +//// } |
---|
| 718 | +//// |
---|
| 719 | +//// if (!generatingDisplayList) |
---|
| 720 | +//// { |
---|
| 721 | +//// applyStates(tris.states, tris); |
---|
| 722 | +//// } |
---|
| 723 | +//// if (Debug.stats) |
---|
| 724 | +//// { |
---|
| 725 | +//// StatCollector.startStat(StatType.STAT_RENDER_TIMER); |
---|
| 726 | +//// } |
---|
| 727 | +//// boolean transformed = doTransforms(tris); |
---|
| 728 | +// |
---|
| 729 | +// int glMode = GL.GL_TRIANGLES; |
---|
| 730 | +// switch (getMode()) |
---|
| 731 | +// { |
---|
| 732 | +// case Triangles: |
---|
| 733 | +// glMode = GL.GL_TRIANGLES; |
---|
| 734 | +// break; |
---|
| 735 | +// case Strip: |
---|
| 736 | +// glMode = GL.GL_TRIANGLE_STRIP; |
---|
| 737 | +// break; |
---|
| 738 | +// case Fan: |
---|
| 739 | +// glMode = GL.GL_TRIANGLE_FAN; |
---|
| 740 | +// break; |
---|
| 741 | +// } |
---|
| 742 | +// |
---|
| 743 | +// if (!predrawGeometry(gl)) |
---|
| 744 | +// { |
---|
| 745 | +// // make sure only the necessary indices are sent through on old |
---|
| 746 | +// // cards. |
---|
| 747 | +// IntBuffer indices = this.getIndexBuffer(); |
---|
| 748 | +// if (indices == null) |
---|
| 749 | +// { |
---|
| 750 | +// logger.severe("missing indices on geometry object: " + this.toString()); |
---|
| 751 | +// } else |
---|
| 752 | +// { |
---|
| 753 | +// indices.rewind(); |
---|
| 754 | +// indices.limit(this.getMaxIndex()); |
---|
| 755 | +// |
---|
| 756 | +// gl.glDrawElements(glMode, indices.limit(), GL.GL_UNSIGNED_INT, indices); // TODO Check <count> and assumed <type> of GL_UNSIGNED_INT |
---|
| 757 | +// |
---|
| 758 | +// indices.clear(); |
---|
| 759 | +// } |
---|
| 760 | +// } else |
---|
| 761 | +// { |
---|
| 762 | +// gl.glDrawElements(glMode, this.getIndexBuffer().limit(), |
---|
| 763 | +// GL.GL_UNSIGNED_INT, 0); |
---|
| 764 | +// } |
---|
| 765 | +// |
---|
| 766 | +//// postdrawGeometry(tris); |
---|
| 767 | +//// if (transformed) |
---|
| 768 | +//// { |
---|
| 769 | +//// undoTransforms(tris); |
---|
| 770 | +//// } |
---|
| 771 | +//// |
---|
| 772 | +//// if (Debug.stats) |
---|
| 773 | +//// { |
---|
| 774 | +//// StatCollector.endStat(StatType.STAT_RENDER_TIMER); |
---|
| 775 | +//// } |
---|
| 776 | +//// tris.postdraw(this); |
---|
| 777 | + } |
---|
| 778 | + |
---|
| 779 | + static Camera localcamera = new Camera(); |
---|
| 780 | + static cVector from = new cVector(); |
---|
| 781 | + static cVector to = new cVector(); |
---|
| 782 | + |
---|
| 783 | + public void PrepOcclusion(BoundaryRep br, double[][] transform) |
---|
| 784 | + { |
---|
| 785 | + CameraPane cp = this; |
---|
| 786 | + |
---|
| 787 | + Camera keep = cp.RenderCamera(); |
---|
| 788 | + cp.renderCamera = localcamera; |
---|
| 789 | + |
---|
| 790 | + if (br.trimmed) |
---|
| 791 | + { |
---|
| 792 | + float[] colors = new float[br.positions.length / 3]; |
---|
| 793 | + |
---|
| 794 | + int i3 = 0; |
---|
| 795 | + for (int i = 0; i < br.positions.length / 3; i++, i3 += 3) |
---|
| 796 | + { |
---|
| 797 | + if (br.normals[i3] == 0 && br.normals[i3+1] == 0 && br.normals[i3+2] == 0) |
---|
| 798 | + continue; |
---|
| 799 | + |
---|
| 800 | + from.set(br.positions[i3], br.positions[i3 + 1], br.positions[i3 + 2]); |
---|
| 801 | + to.set(br.positions[i3] + br.normals[i3], |
---|
| 802 | + br.positions[i3 + 1] + br.normals[i3 + 1], |
---|
| 803 | + br.positions[i3 + 2] + br.normals[i3 + 2]); |
---|
| 804 | + LA.xformPos(from, transform, from); |
---|
| 805 | + LA.xformPos(to, transform, to); // RIGID ONLY |
---|
| 806 | + localcamera.setAim(from, to); |
---|
| 807 | + |
---|
| 808 | + CameraPane.occlusionbuffer.display(); |
---|
| 809 | + |
---|
| 810 | + if (CameraPane.DEBUG_OCCLUSION) |
---|
| 811 | + cp.display(); // debug |
---|
| 812 | + |
---|
| 813 | + colors[i] = cp.vertexOcclusion.r; |
---|
| 814 | + //colors[i3 + 1] = cp.vertexOcclusion.g; |
---|
| 815 | + //colors[i3 + 2] = cp.vertexOcclusion.b; |
---|
| 816 | + |
---|
| 817 | + if ((i % 100) == 0 && i != 0) |
---|
| 818 | + { |
---|
| 819 | + CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 820 | + //System.out.println("Color = " + cp.vertexOcclusion.r + ", " + cp.vertexOcclusion.g + ", " + cp.vertexOcclusion.b + "; " + (int)(100.0*i/(positions.length/3)) + "% done"); |
---|
| 821 | + System.out.println((int) (100.0 * i / (br.positions.length / 3)) + "% (" + i + " of " + (br.positions.length / 3) + ")"); |
---|
| 822 | + } |
---|
| 823 | + } |
---|
| 824 | + |
---|
| 825 | + br.colors = colors; |
---|
| 826 | + } |
---|
| 827 | + else |
---|
| 828 | + { |
---|
| 829 | + for (int i = 0; i < br.VertexCount(); i++) |
---|
| 830 | + { |
---|
| 831 | + Vertex v = br.GetVertex(i); |
---|
| 832 | + |
---|
| 833 | + if (v.norm == null || v.norm.x == 0 && v.norm.y == 0 && v.norm.z == 0) |
---|
| 834 | + continue; |
---|
| 835 | + |
---|
| 836 | + from.set(v.x, v.y, v.z); |
---|
| 837 | + to.set(v.x+v.norm.x, v.y+v.norm.y, v.z+v.norm.z); |
---|
| 838 | + LA.xformPos(from, transform, from); |
---|
| 839 | + LA.xformPos(to, transform, to); // RIGID ONLY |
---|
| 840 | + localcamera.setAim(from, to); |
---|
| 841 | + |
---|
| 842 | + CameraPane.occlusionbuffer.display(); |
---|
| 843 | + |
---|
| 844 | + if (CameraPane.DEBUG_OCCLUSION) |
---|
| 845 | + cp.display(); // debug |
---|
| 846 | + |
---|
| 847 | + v.AO = cp.vertexOcclusion.r; |
---|
| 848 | + |
---|
| 849 | + if ((i % 100) == 0 && i != 0) |
---|
| 850 | + { |
---|
| 851 | + CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 852 | + //System.out.println("Color = " + cp.vertexOcclusion.r + ", " + cp.vertexOcclusion.g + ", " + cp.vertexOcclusion.b + "; " + (int)(100.0*i/(positions.length/3)) + "% done"); |
---|
| 853 | + System.out.println((int) (100.0 * i / br.VertexCount()) + "% (" + i + " of " + br.VertexCount() + ")"); |
---|
| 854 | + } |
---|
| 855 | + } |
---|
| 856 | + } |
---|
| 857 | + |
---|
| 858 | + //System.out.println("done."); |
---|
| 859 | + |
---|
| 860 | + cp.renderCamera = keep; |
---|
| 861 | + } |
---|
| 862 | + |
---|
| 863 | + void DrawPointFLow(PointFlow pointFlow, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
| 864 | + { |
---|
| 865 | + CameraPane display = this; |
---|
| 866 | + pointFlow.CreateHT(); |
---|
| 867 | + |
---|
| 868 | + float r = display.modelParams0[0]; |
---|
| 869 | + float g = display.modelParams0[1]; |
---|
| 870 | + float b = display.modelParams0[2]; |
---|
| 871 | + float opacity = display.modelParams5[1]; |
---|
| 872 | + |
---|
| 873 | + //final GL gl = GLU.getCurrentGL(); |
---|
| 874 | + GL gl = display.GetGL(); // getGL(); |
---|
| 875 | + |
---|
| 876 | + int s = pointFlow.points.size(); |
---|
| 877 | + |
---|
| 878 | + boolean cf = gl.glIsEnabled(gl.GL_CULL_FACE); |
---|
| 879 | + gl.glEnable(gl.GL_CULL_FACE); |
---|
| 880 | + |
---|
| 881 | + for (int i=s; --i>=0;) |
---|
| 882 | + //for (int i=0; i<s; i++) |
---|
| 883 | + { |
---|
| 884 | + cVector v = pointFlow.points.get(i); |
---|
| 885 | + |
---|
| 886 | + double mindist = Double.MAX_VALUE; |
---|
| 887 | + |
---|
| 888 | + double size = pointFlow.minimumSize; |
---|
| 889 | + |
---|
| 890 | + double distancenext = 0; |
---|
| 891 | + |
---|
| 892 | + if (i > 0) |
---|
| 893 | + { |
---|
| 894 | + cVector w = pointFlow.points.get(i-1); |
---|
| 895 | + |
---|
| 896 | + double dist = w.distance(v); |
---|
| 897 | + |
---|
| 898 | + distancenext = dist; |
---|
| 899 | + |
---|
| 900 | + if (mindist > dist) |
---|
| 901 | + { |
---|
| 902 | + mindist = dist; |
---|
| 903 | + size = mindist*pointFlow.resizefactor; |
---|
| 904 | + } |
---|
| 905 | + } |
---|
| 906 | + |
---|
| 907 | + if (i < s-1) |
---|
| 908 | + { |
---|
| 909 | + cVector w = pointFlow.points.get(i+1); |
---|
| 910 | + |
---|
| 911 | + double dist = w.distance(v); |
---|
| 912 | + |
---|
| 913 | + if (mindist > dist) |
---|
| 914 | + { |
---|
| 915 | + mindist = dist; |
---|
| 916 | + size = mindist*pointFlow.resizefactor; |
---|
| 917 | + } |
---|
| 918 | + } |
---|
| 919 | + |
---|
| 920 | + if (size < pointFlow.minimumSize) |
---|
| 921 | + size = pointFlow.minimumSize; |
---|
| 922 | + if (size > pointFlow.maximumSize) |
---|
| 923 | + size = pointFlow.maximumSize; |
---|
| 924 | + |
---|
| 925 | + double tx = v.x; |
---|
| 926 | + double ty = v.y; |
---|
| 927 | + double tz = v.z; |
---|
| 928 | + |
---|
| 929 | + // if (tx == 0 && ty == 0 && tz == 0) |
---|
| 930 | + // continue; |
---|
| 931 | + |
---|
| 932 | + gl.glMatrixMode(gl.GL_TEXTURE); |
---|
| 933 | + gl.glPushMatrix(); |
---|
| 934 | + pointFlow.texmat[12] = pointFlow.texmat[13] = pointFlow.texmat[14] = i; |
---|
| 935 | + |
---|
| 936 | + gl.glMultMatrixf(pointFlow.texmat, 0); |
---|
| 937 | + |
---|
| 938 | + gl.glMatrixMode(gl.GL_MODELVIEW); |
---|
| 939 | + gl.glPushMatrix(); |
---|
| 940 | + |
---|
| 941 | + gl.glTranslated(tx,ty,tz); |
---|
| 942 | + |
---|
| 943 | + gl.glScaled(size,size,size); |
---|
| 944 | + |
---|
| 945 | +// float cr = colorBuf.get(index4); |
---|
| 946 | +// float cg = colorBuf.get(index4+1); |
---|
| 947 | +// float cb = colorBuf.get(index4+2); |
---|
| 948 | +// float ca = colorBuf.get(index4+3); |
---|
| 949 | +// |
---|
| 950 | +// display.modelParams0[0] = r * cr; |
---|
| 951 | +// display.modelParams0[1] = g * cg; |
---|
| 952 | +// display.modelParams0[2] = b * cb; |
---|
| 953 | +// |
---|
| 954 | +// display.modelParams5[1] = opacity * ca; |
---|
| 955 | +// |
---|
| 956 | +// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 0, display.modelParams0, 0); |
---|
| 957 | +// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 5, display.modelParams5, 0); |
---|
| 958 | +// |
---|
| 959 | +// RandomNode.globalseed = (int)sizeBuf.get(index3+2); // i; |
---|
| 960 | +// RandomNode.globalseed2 = RandomNode.globalseed; |
---|
| 961 | +// |
---|
| 962 | +//// gl.glColor4f(cr,cg,cb,ca); |
---|
| 963 | +// // gl.glScalef(1024/16,1024/16,1024/16); |
---|
| 964 | + pointFlow.geo.Draw/*Node*/(display,null,selected, blocked); |
---|
| 965 | + |
---|
| 966 | + gl.glPopMatrix(); |
---|
| 967 | + |
---|
| 968 | + double step = size/4; // |
---|
| 969 | + |
---|
| 970 | + if (i == 0 || size == 0 || distancenext > 8*size || distancenext < step) |
---|
| 971 | + continue; |
---|
| 972 | + |
---|
| 973 | + int nbsteps = (int)(distancenext/step); |
---|
| 974 | + |
---|
| 975 | + step = distancenext/nbsteps; |
---|
| 976 | + |
---|
| 977 | + cVector next = pointFlow.points.get(i-1); |
---|
| 978 | + |
---|
| 979 | + tmp.set(next); |
---|
| 980 | + tmp.sub(v); |
---|
| 981 | + tmp.normalize(); |
---|
| 982 | + tmp.mul(step); |
---|
| 983 | + |
---|
| 984 | + // calculate next size |
---|
| 985 | + mindist = Double.MAX_VALUE; |
---|
| 986 | + |
---|
| 987 | + double nextsize = pointFlow.minimumSize; |
---|
| 988 | + |
---|
| 989 | + if (i > 1) |
---|
| 990 | + { |
---|
| 991 | + cVector w = pointFlow.points.get(i-2); |
---|
| 992 | + |
---|
| 993 | + double dist = w.distance(next); |
---|
| 994 | + |
---|
| 995 | + if (mindist > dist) |
---|
| 996 | + { |
---|
| 997 | + mindist = dist; |
---|
| 998 | + nextsize = mindist*pointFlow.resizefactor; |
---|
| 999 | + } |
---|
| 1000 | + } |
---|
| 1001 | + |
---|
| 1002 | + double dist = v.distance(next); |
---|
| 1003 | + |
---|
| 1004 | + if (mindist > dist) |
---|
| 1005 | + { |
---|
| 1006 | + mindist = dist; |
---|
| 1007 | + nextsize = mindist*pointFlow.resizefactor; |
---|
| 1008 | + } |
---|
| 1009 | + |
---|
| 1010 | + if (nextsize < pointFlow.minimumSize) |
---|
| 1011 | + nextsize = pointFlow.minimumSize; |
---|
| 1012 | + if (nextsize > pointFlow.maximumSize) |
---|
| 1013 | + nextsize = pointFlow.maximumSize; |
---|
| 1014 | + // |
---|
| 1015 | + |
---|
| 1016 | + double count = 0; |
---|
| 1017 | + |
---|
| 1018 | + while (distancenext > 0.000000001) // step |
---|
| 1019 | + { |
---|
| 1020 | + gl.glPushMatrix(); |
---|
| 1021 | + |
---|
| 1022 | + gl.glTranslated(tx + tmp.x*count, ty + tmp.y*count, tz + tmp.z*count); |
---|
| 1023 | + |
---|
| 1024 | + double K = count/nbsteps; |
---|
| 1025 | + |
---|
| 1026 | + double intersize = K*nextsize + (1-K)*size; |
---|
| 1027 | + |
---|
| 1028 | + gl.glScaled(intersize,intersize,intersize); |
---|
| 1029 | + |
---|
| 1030 | + pointFlow.geo.Draw/*Node*/(display,null,selected,blocked); |
---|
| 1031 | + |
---|
| 1032 | + count++; |
---|
| 1033 | + |
---|
| 1034 | + distancenext -= step; |
---|
| 1035 | + |
---|
| 1036 | + gl.glPopMatrix(); |
---|
| 1037 | + } |
---|
| 1038 | + |
---|
| 1039 | + if (count != nbsteps) |
---|
| 1040 | + assert(count == nbsteps); |
---|
| 1041 | + |
---|
| 1042 | + // gl.glScalef(16.0f/1024,16.0f/1024,16.0f/1024); |
---|
| 1043 | + //gl.glTranslatef(-tx,-ty,-tz); |
---|
| 1044 | + |
---|
| 1045 | + gl.glMatrixMode(gl.GL_TEXTURE); |
---|
| 1046 | + gl.glPopMatrix(); |
---|
| 1047 | + } |
---|
| 1048 | + |
---|
| 1049 | + if (!cf) |
---|
| 1050 | + gl.glDisable(gl.GL_CULL_FACE); |
---|
| 1051 | + |
---|
| 1052 | +// display.modelParams0[0] = r; |
---|
| 1053 | +// display.modelParams0[1] = g; |
---|
| 1054 | +// display.modelParams0[2] = b; |
---|
| 1055 | +// |
---|
| 1056 | +// display.modelParams5[1] = opacity; |
---|
| 1057 | +// |
---|
| 1058 | +// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 0, display.modelParams0, 0); |
---|
| 1059 | +// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 5, display.modelParams5, 0); |
---|
| 1060 | + |
---|
| 1061 | + gl.glMatrixMode(gl.GL_MODELVIEW); |
---|
| 1062 | + } |
---|
| 1063 | + |
---|
| 1064 | + /// INTERFACE |
---|
| 1065 | + |
---|
| 1066 | + void SetColor(Object3D obj, Vertex p0) |
---|
| 1067 | + { |
---|
| 1068 | + CameraPane display = this; |
---|
| 1069 | + BoundaryRep bRep = obj.bRep; |
---|
| 1070 | + |
---|
| 1071 | + if (RENDERPROGRAM == 0) |
---|
| 1072 | + { |
---|
| 1073 | + float r = 0; |
---|
| 1074 | + if (bRep != null) |
---|
| 1075 | + { |
---|
| 1076 | + if (bRep.stripified) |
---|
| 1077 | + { |
---|
| 1078 | + r = 1; |
---|
| 1079 | + } |
---|
| 1080 | + } |
---|
| 1081 | + float g = 0; |
---|
| 1082 | + if (bRep != null) |
---|
| 1083 | + { |
---|
| 1084 | + if (bRep.trimmed) |
---|
| 1085 | + { |
---|
| 1086 | + g = 1; |
---|
| 1087 | + } |
---|
| 1088 | + } |
---|
| 1089 | + float b = 0; |
---|
| 1090 | + if (obj.support != null && obj.link2master) |
---|
| 1091 | + { |
---|
| 1092 | + b = 1; |
---|
| 1093 | + } |
---|
| 1094 | + display.GetGL().glColor3f(r*p0.AO, g*p0.AO, b*p0.AO); |
---|
| 1095 | + return; |
---|
| 1096 | + } |
---|
| 1097 | + |
---|
| 1098 | + if (display.DrawMode() != CameraPane.SHADOW) |
---|
| 1099 | + return; |
---|
| 1100 | + |
---|
| 1101 | + javax.media.opengl.GL gl = display.GetGL(); |
---|
| 1102 | +// if (true) return; |
---|
| 1103 | +// float ao = p.AO; |
---|
| 1104 | +// |
---|
| 1105 | +// // if (ao == 0 && !bRep.AOdone) // transient problem! |
---|
| 1106 | +// // ao = 1; |
---|
| 1107 | +// |
---|
| 1108 | +// gl.glColor4f(ao, ao, ao, 1); |
---|
| 1109 | + |
---|
| 1110 | +// CameraPane.selectedpoint. |
---|
| 1111 | +// getAverage(cStatic.point1, true); |
---|
| 1112 | + if (CameraPane.pointflow == null) // !random) // live) |
---|
| 1113 | + { |
---|
| 1114 | + return; |
---|
| 1115 | + } |
---|
| 1116 | + |
---|
| 1117 | + cStatic.point1.set(0,0,0); |
---|
| 1118 | + LA.xformPos(cStatic.point1, CameraPane.selectedpoint.toParent, cStatic.point1); |
---|
| 1119 | + |
---|
| 1120 | + cStatic.point1.sub(p0); |
---|
| 1121 | + |
---|
| 1122 | + |
---|
| 1123 | +// if (marked && (p0.vertexlinks == null || support == null || support.bRep == null)) // no position delta? |
---|
| 1124 | +// { |
---|
| 1125 | +// return; |
---|
| 1126 | +// } |
---|
| 1127 | + |
---|
| 1128 | + //if (true) |
---|
| 1129 | + if (cStatic.point1.dot(cStatic.point1) > 0.000001) |
---|
| 1130 | + { |
---|
| 1131 | + return; |
---|
| 1132 | + } |
---|
| 1133 | + |
---|
| 1134 | + float[] colorV = new float[3]; |
---|
| 1135 | + |
---|
| 1136 | + if (false) // marked) |
---|
| 1137 | + { |
---|
| 1138 | + // debug rigging weights |
---|
| 1139 | + for (int object = 0; object < p0.vertexlinks.length; object++) |
---|
| 1140 | + { |
---|
| 1141 | + float weight = p0.weights[object] / p0.totalweight; |
---|
| 1142 | + |
---|
| 1143 | + // if (weight < 0.1) |
---|
| 1144 | + // { |
---|
| 1145 | + // assert(weight == 0); |
---|
| 1146 | + // continue; |
---|
| 1147 | + // } |
---|
| 1148 | + |
---|
| 1149 | + if (p0.vertexlinks[object] == -1) |
---|
| 1150 | + continue; |
---|
| 1151 | + |
---|
| 1152 | + Vertex q = obj.support.bRep.GetVertex(p0.vertexlinks[object]); |
---|
| 1153 | + |
---|
| 1154 | + int color = //1 << object; // |
---|
| 1155 | + //p.vertexlinks.length; |
---|
| 1156 | + obj.support.bRep.supports[p0.closestsupport].links[object]; |
---|
| 1157 | + colorV[2] += (color & 1) * weight; |
---|
| 1158 | + colorV[1] += ((color & 2) >> 1) * weight; |
---|
| 1159 | + colorV[0] += ((color & 4) >> 2) * weight; |
---|
| 1160 | + } |
---|
| 1161 | + } |
---|
| 1162 | + else |
---|
| 1163 | + { |
---|
| 1164 | + if (obj.drawingstarted) |
---|
| 1165 | + { |
---|
| 1166 | + // find next point |
---|
| 1167 | + if (bRep.GetVertex(0).faceindices == null) |
---|
| 1168 | + { |
---|
| 1169 | + bRep.InitFaceIndices(); |
---|
| 1170 | + } |
---|
| 1171 | + |
---|
| 1172 | + double ymin = p0.y; |
---|
| 1173 | + |
---|
| 1174 | + Vertex newp = p0; |
---|
| 1175 | + |
---|
| 1176 | + for (int fii = 0; fii < p0.faceindices.length; fii++) |
---|
| 1177 | + { |
---|
| 1178 | + int fi = p0.faceindices[fii]; |
---|
| 1179 | + |
---|
| 1180 | + if (fi == -1) |
---|
| 1181 | + break; |
---|
| 1182 | + |
---|
| 1183 | + Face f = bRep.GetFace(fi); |
---|
| 1184 | + |
---|
| 1185 | + Vertex p = bRep.GetVertex(f.p); |
---|
| 1186 | + Vertex q = bRep.GetVertex(f.q); |
---|
| 1187 | + Vertex r = bRep.GetVertex(f.r); |
---|
| 1188 | + |
---|
| 1189 | + int swap = (int)(Math.random()*3); |
---|
| 1190 | + |
---|
| 1191 | +// for (int s=swap; --s>=0;) |
---|
| 1192 | +// { |
---|
| 1193 | +// Vertex t = p; |
---|
| 1194 | +// p = q; |
---|
| 1195 | +// q = r; |
---|
| 1196 | +// r = t; |
---|
| 1197 | +// } |
---|
| 1198 | + if (ymin > p.y) |
---|
| 1199 | + { |
---|
| 1200 | + ymin = p.y; |
---|
| 1201 | + newp = p; |
---|
| 1202 | +// break; |
---|
| 1203 | + } |
---|
| 1204 | + if (ymin > q.y) |
---|
| 1205 | + { |
---|
| 1206 | + ymin = q.y; |
---|
| 1207 | + newp = q; |
---|
| 1208 | +// break; |
---|
| 1209 | + } |
---|
| 1210 | + if (ymin > r.y) |
---|
| 1211 | + { |
---|
| 1212 | + ymin = r.y; |
---|
| 1213 | + newp = r; |
---|
| 1214 | +// break; |
---|
| 1215 | + } |
---|
| 1216 | + } |
---|
| 1217 | + |
---|
| 1218 | + CameraPane.selectedpoint.toParent[3][0] = newp.x; |
---|
| 1219 | + CameraPane.selectedpoint.toParent[3][1] = newp.y; |
---|
| 1220 | + CameraPane.selectedpoint.toParent[3][2] = newp.z; |
---|
| 1221 | + |
---|
| 1222 | + obj.drawingstarted = false; |
---|
| 1223 | + |
---|
| 1224 | + // return; |
---|
| 1225 | + } |
---|
| 1226 | + |
---|
| 1227 | + if (false) // CameraPane.DRAW |
---|
| 1228 | + { |
---|
| 1229 | + p0.AO = colorV[0] = 2; |
---|
| 1230 | + colorV[1] = 2; |
---|
| 1231 | + colorV[2] = 2; |
---|
| 1232 | + } |
---|
| 1233 | + |
---|
| 1234 | + CameraPane.pointflow.add(p0); |
---|
| 1235 | + CameraPane.pointflow.Touch(); |
---|
| 1236 | + } |
---|
| 1237 | + |
---|
| 1238 | +// gl.glColor3f(colorV[0], colorV[1], colorV[2]); |
---|
| 1239 | +// gl.glMaterialfv(gl.GL_FRONT, gl.GL_DIFFUSE, colorV, 0); |
---|
| 1240 | +// gl.glMaterialfv(gl.GL_BACK, gl.GL_DIFFUSE, colorV, 0); |
---|
| 1241 | + } |
---|
| 1242 | + |
---|
| 1243 | + void DrawMaterial(cMaterial material, boolean selected) |
---|
| 1244 | + { |
---|
| 1245 | + CameraPane display = this; |
---|
| 1246 | + //new Exception().printStackTrace(); |
---|
| 1247 | + |
---|
| 1248 | + if (display.IsFrozen() && !selected || display.IsAmbientOcclusionOn()) // || display.drawMode == display.SHADOW) |
---|
| 1249 | + { |
---|
| 1250 | + return; |
---|
| 1251 | + } |
---|
| 1252 | + |
---|
| 1253 | + javax.media.opengl.GL gl = display.GetGL(); |
---|
| 1254 | + |
---|
| 1255 | + //Color col = Color.getHSBColor(color,modulation,1); |
---|
| 1256 | + //col.getColorComponents(ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB), CameraPane.modelParams0); |
---|
| 1257 | + if (!material.multiply) |
---|
| 1258 | + { |
---|
| 1259 | + display.color = color; |
---|
| 1260 | + display.saturation = material.modulation; |
---|
| 1261 | + } |
---|
| 1262 | + else |
---|
| 1263 | + { |
---|
| 1264 | + display.color *= color*2; |
---|
| 1265 | + display.saturation *= material.modulation*2; |
---|
| 1266 | + } |
---|
| 1267 | + |
---|
| 1268 | + cColor.HSBtoRGB(display.color, display.saturation, 1, display.modelParams0); |
---|
| 1269 | + |
---|
| 1270 | + float[] colorV = GrafreeD.colorV; |
---|
| 1271 | + |
---|
| 1272 | + /**/ |
---|
| 1273 | + if (display.DrawMode() == display.DEFAULT) // && display.RENDERPROGRAM == 0) |
---|
| 1274 | + { |
---|
| 1275 | + colorV[0] = display.modelParams0[0] * material.diffuse; |
---|
| 1276 | + colorV[1] = display.modelParams0[1] * material.diffuse; |
---|
| 1277 | + colorV[2] = display.modelParams0[2] * material.diffuse; |
---|
| 1278 | + colorV[3] = material.opacity; |
---|
| 1279 | + |
---|
| 1280 | + gl.glColor4f(colorV[0], colorV[1], colorV[2], material.opacity); |
---|
| 1281 | + //System.out.println("Opacity = " + opacity); |
---|
| 1282 | + |
---|
| 1283 | + gl.glMaterialfv(gl.GL_FRONT, gl.GL_DIFFUSE, colorV, 0); |
---|
| 1284 | + //color[0] /= 2; color[1] /= 2; color[2] /= 2; |
---|
| 1285 | + gl.glMaterialfv(gl.GL_BACK, gl.GL_DIFFUSE, colorV, 0); |
---|
| 1286 | + |
---|
| 1287 | + float amb = material.ambient; |
---|
| 1288 | + if (amb < material.cameralight) |
---|
| 1289 | + { |
---|
| 1290 | + amb = material.cameralight; |
---|
| 1291 | + } |
---|
| 1292 | + colorV[0] = display.modelParams0[0] * material.diffuse * amb; |
---|
| 1293 | + colorV[1] = display.modelParams0[1] * material.diffuse * amb; |
---|
| 1294 | + colorV[2] = display.modelParams0[2] * material.diffuse * amb; |
---|
| 1295 | + gl.glMaterialfv(gl.GL_FRONT, gl.GL_AMBIENT, colorV, 0); |
---|
| 1296 | + //color[0] /= 2; color[1] /= 2; color[2] /= 2; |
---|
| 1297 | + gl.glMaterialfv(gl.GL_BACK, gl.GL_AMBIENT, colorV, 0); |
---|
| 1298 | + |
---|
| 1299 | + /**/ |
---|
| 1300 | + colorV[0] = ((1 - material.metalness) + display.modelParams0[0] * material.metalness) * material.specular; |
---|
| 1301 | + colorV[1] = ((1 - material.metalness) + display.modelParams0[1] * material.metalness) * material.specular; |
---|
| 1302 | + colorV[2] = ((1 - material.metalness) + display.modelParams0[2] * material.metalness) * material.specular; |
---|
| 1303 | + gl.glMaterialfv(gl.GL_FRONT, gl.GL_SPECULAR, colorV, 0); |
---|
| 1304 | + //color[0] /= 2; color[1] /= 2; color[2] /= 2; |
---|
| 1305 | + gl.glMaterialfv(gl.GL_BACK, gl.GL_SPECULAR, colorV, 0); |
---|
| 1306 | + colorV[0] = 10 / material.shininess; // 1/0.005f; |
---|
| 1307 | + //System.out.println("shininess = " + colorV[0]); |
---|
| 1308 | + if (colorV[0] > 128) |
---|
| 1309 | + { |
---|
| 1310 | + colorV[0] = 128; |
---|
| 1311 | + } |
---|
| 1312 | + gl.glMaterialfv(gl.GL_FRONT, gl.GL_SHININESS, colorV, 0); |
---|
| 1313 | + gl.glMaterialfv(gl.GL_BACK, gl.GL_SHININESS, colorV, 0); |
---|
| 1314 | + /**/ |
---|
| 1315 | + } |
---|
| 1316 | + /**/ |
---|
| 1317 | + |
---|
| 1318 | + //selected = false; |
---|
| 1319 | + selected = selected && display.flash; |
---|
| 1320 | + |
---|
| 1321 | + //display.modelParams0[0] = 0; // pigment.r; |
---|
| 1322 | + //display.modelParams0[1] = 0; // pigment.g; |
---|
| 1323 | + //display.modelParams0[2] = 0; // pigment.b; |
---|
| 1324 | + if (!material.multiply) |
---|
| 1325 | + { |
---|
| 1326 | + display.modelParams0[3] = material.metalness; |
---|
| 1327 | + display.modelParams1[0] = material.diffuse; |
---|
| 1328 | + display.modelParams1[1] = material.specular; |
---|
| 1329 | + display.modelParams1[2] = 1 / material.shininess; |
---|
| 1330 | + display.modelParams1[3] = material.shift; |
---|
| 1331 | + display.modelParams2[0] = material.ambient; |
---|
| 1332 | + display.modelParams2[1] = material.lightarea; |
---|
| 1333 | + //System.out.println("light area = " + lightarea); |
---|
| 1334 | + display.modelParams2[2] = 1 / material.factor; // diffuseness |
---|
| 1335 | + display.modelParams2[3] = material.velvet; |
---|
| 1336 | + display.modelParams3[0] = material.sheen; |
---|
| 1337 | + display.modelParams3[1] = material.subsurface; |
---|
| 1338 | + display.modelParams3[2] = material.bump; // backlit |
---|
| 1339 | + display.modelParams3[3] = material.aniso; |
---|
| 1340 | + display.modelParams4[0] = material.anisoV; |
---|
| 1341 | + display.modelParams4[1] = selected ? 100 : material.cameralight; |
---|
| 1342 | + //System.out.println("selected = " + selected); |
---|
| 1343 | + display.modelParams4[2] = material.diffuseness; |
---|
| 1344 | + display.modelParams4[3] = material.shadow; |
---|
| 1345 | + display.modelParams5[0] = material.texture; |
---|
| 1346 | + display.modelParams5[1] = material.opacity; |
---|
| 1347 | + display.modelParams5[2] = material.fakedepth; |
---|
| 1348 | + display.modelParams5[3] = CameraPane.SHADOWCULLFACE ? 0f : (material.shadowbias - 0.005f) / 10; |
---|
| 1349 | + } |
---|
| 1350 | + else |
---|
| 1351 | + { |
---|
| 1352 | + display.modelParams0[3] *= material.metalness*2; |
---|
| 1353 | + display.modelParams1[0] *= material.diffuse*2; |
---|
| 1354 | + display.modelParams1[1] *= material.specular*2; |
---|
| 1355 | + display.modelParams1[2] *= material.shininess*2; |
---|
| 1356 | + display.modelParams1[3] *= material.shift*2; |
---|
| 1357 | + display.modelParams2[0] *= material.ambient*2; |
---|
| 1358 | + display.modelParams2[1] *= material.lightarea*2; |
---|
| 1359 | + display.modelParams2[2] *= material.factor*2; |
---|
| 1360 | + display.modelParams2[3] *= material.velvet*2; |
---|
| 1361 | + display.modelParams3[0] *= material.sheen*2; |
---|
| 1362 | + display.modelParams3[1] *= material.subsurface*2; |
---|
| 1363 | + display.modelParams3[2] *= material.bump*2; |
---|
| 1364 | + display.modelParams3[3] *= material.aniso*2; |
---|
| 1365 | + display.modelParams4[0] *= material.anisoV*2; |
---|
| 1366 | + display.modelParams4[1] *= material.cameralight*2; |
---|
| 1367 | + //System.out.println("selected = " + selected); |
---|
| 1368 | + display.modelParams4[2] *= material.diffuseness*2; |
---|
| 1369 | + display.modelParams4[3] *= material.shadow*2; |
---|
| 1370 | + display.modelParams5[0] *= material.texture*2; |
---|
| 1371 | + display.modelParams5[1] *= material.opacity*2; |
---|
| 1372 | + display.modelParams5[2] *= material.fakedepth*2; |
---|
| 1373 | + display.modelParams5[3] *= material.shadowbias*2; |
---|
| 1374 | + } |
---|
| 1375 | + |
---|
| 1376 | + display.modelParams6[0] = 0; |
---|
| 1377 | + display.modelParams6[1] = 0; |
---|
| 1378 | + display.modelParams6[2] = 0; |
---|
| 1379 | + display.modelParams6[3] = 0; |
---|
| 1380 | + |
---|
| 1381 | + display.modelParams7[0] = 0; |
---|
| 1382 | + display.modelParams7[1] = 1000; |
---|
| 1383 | + display.modelParams7[2] = 0; |
---|
| 1384 | + display.modelParams7[3] = 0; |
---|
| 1385 | + |
---|
| 1386 | + display.modelParams6[0] = 100; // criss de bug de bump |
---|
| 1387 | + |
---|
| 1388 | + Object3D.cVector2[] extparams = display.vector2buffer; |
---|
| 1389 | + if (extparams != null && extparams.length > 0 && extparams[0] != null) |
---|
| 1390 | + { |
---|
| 1391 | + display.modelParams6[0] = extparams[0].x / 1000.0f; // bump |
---|
| 1392 | + display.modelParams6[1] = extparams[0].y / 1000.0f; // noise |
---|
| 1393 | + if (extparams.length > 1) |
---|
| 1394 | + { |
---|
| 1395 | + display.modelParams6[2] = extparams[1].x / 1000.0f; // borderfade |
---|
| 1396 | + display.modelParams6[3] = extparams[1].y / 1000.0f; // (float)Math.exp(-extparams[1].y / 1000.0f); // fog punchthrough |
---|
| 1397 | + if (extparams.length > 2) |
---|
| 1398 | + { |
---|
| 1399 | + display.modelParams7[0] = extparams[2].x / 1000.0f; // noise power |
---|
| 1400 | + float x = extparams[2].y / 1000.0f; |
---|
| 1401 | + //if (x == 0) |
---|
| 1402 | + // x = 1f; |
---|
| 1403 | + display.modelParams7[1] = 1 / x / x / x / x / x / x / x / x / x / x / x / x / x; // (float)Math.pow(-Math.log((extparams[2].y+0.00) / 1000.0f), 1); // opacity power |
---|
| 1404 | + if (extparams[2].y > 0) |
---|
| 1405 | + { |
---|
| 1406 | + //System.out.println("extparams[1].y = " + extparams[1].y); |
---|
| 1407 | + //System.out.println("extparams[2].y = " + extparams[2].y); |
---|
| 1408 | + //System.out.println("opacity power = " + display.modelParams7[1]); |
---|
| 1409 | + } |
---|
| 1410 | + } |
---|
| 1411 | + } |
---|
| 1412 | + } |
---|
| 1413 | + |
---|
| 1414 | + //if (display.modelParams6[2] != 0) |
---|
| 1415 | + /* |
---|
| 1416 | + System.out.println("modelParams0[0] = " + display.modelParams0[0]); |
---|
| 1417 | + System.out.println("modelParams0[1] = " + display.modelParams0[1]); |
---|
| 1418 | + System.out.println("modelParams0[2] = " + display.modelParams0[2]); |
---|
| 1419 | + System.out.println("modelParams0[3] = " + display.modelParams0[3]); |
---|
| 1420 | + System.out.println("modelParams1[0] = " + display.modelParams1[0]); |
---|
| 1421 | + System.out.println("modelParams1[1] = " + display.modelParams1[1]); |
---|
| 1422 | + System.out.println("modelParams1[2] = " + display.modelParams1[2]); |
---|
| 1423 | + System.out.println("modelParams1[3] = " + display.modelParams1[3]); |
---|
| 1424 | + System.out.println("modelParams2[0] = " + display.modelParams2[0]); |
---|
| 1425 | + System.out.println("modelParams2[1] = " + display.modelParams2[1]); |
---|
| 1426 | + System.out.println("modelParams2[2] = " + display.modelParams2[2]); |
---|
| 1427 | + System.out.println("modelParams2[3] = " + display.modelParams2[3]); |
---|
| 1428 | + System.out.println("modelParams3[0] = " + display.modelParams3[0]); |
---|
| 1429 | + System.out.println("modelParams3[1] = " + display.modelParams3[1]); |
---|
| 1430 | + System.out.println("modelParams3[2] = " + display.modelParams3[2]); |
---|
| 1431 | + System.out.println("modelParams3[3] = " + display.modelParams3[3]); |
---|
| 1432 | + System.out.println("modelParams4[0] = " + display.modelParams4[0]); |
---|
| 1433 | + System.out.println("modelParams4[1] = " + display.modelParams4[1]); |
---|
| 1434 | + System.out.println("modelParams4[2] = " + display.modelParams4[2]); |
---|
| 1435 | + System.out.println("modelParams4[3] = " + display.modelParams4[3]); |
---|
| 1436 | + System.out.println("modelParams5[0] = " + display.modelParams5[0]); |
---|
| 1437 | + System.out.println("modelParams5[1] = " + display.modelParams5[1]); |
---|
| 1438 | + System.out.println("modelParams5[2] = " + display.modelParams5[2]); |
---|
| 1439 | + System.out.println("modelParams5[3] = " + display.modelParams5[3]); |
---|
| 1440 | + System.out.println("modelParams6[0] = " + display.modelParams6[0]); |
---|
| 1441 | + System.out.println("modelParams6[1] = " + display.modelParams6[1]); |
---|
| 1442 | + System.out.println("modelParams6[2] = " + display.modelParams6[2]); |
---|
| 1443 | + System.out.println("modelParams6[3] = " + display.modelParams6[3]); |
---|
| 1444 | + System.out.println("modelParams7[0] = " + display.modelParams7[0]); |
---|
| 1445 | + System.out.println("modelParams7[1] = " + display.modelParams7[1]); |
---|
| 1446 | + System.out.println("modelParams7[2] = " + display.modelParams7[2]); |
---|
| 1447 | + System.out.println("modelParams7[3] = " + display.modelParams7[3]); |
---|
| 1448 | + /**/ |
---|
| 1449 | + //assert (display.modelParams6[2] == 0); |
---|
| 1450 | + |
---|
| 1451 | + //System.out.println("noise power = " + display.modelParams7[0]); |
---|
| 1452 | + //System.out.println("shadowbias = " + shadowbias); |
---|
| 1453 | + |
---|
| 1454 | + gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 0, display.modelParams0, 0); |
---|
| 1455 | + gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 1, display.modelParams1, 0); |
---|
| 1456 | + gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 2, display.modelParams2, 0); |
---|
| 1457 | + gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 3, display.modelParams3, 0); |
---|
| 1458 | + gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 4, display.modelParams4, 0); |
---|
| 1459 | + gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 5, display.modelParams5, 0); |
---|
| 1460 | + gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 6, display.modelParams6, 0); |
---|
| 1461 | + gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 7, display.modelParams7, 0); |
---|
| 1462 | + |
---|
| 1463 | + int mode = display.FP_SHADER; |
---|
| 1464 | + |
---|
| 1465 | + if (material.aniso != material.anisoV || material.aniso > 0.002) |
---|
| 1466 | + { |
---|
| 1467 | + mode |= display.FP_ANISO; |
---|
| 1468 | + } |
---|
| 1469 | + |
---|
| 1470 | + display.EnableProgram(mode); |
---|
| 1471 | + |
---|
| 1472 | + //System.out.println("opacity power = " + display.modelParams7[1]); |
---|
| 1473 | + |
---|
| 1474 | + if (!material.multiply) |
---|
| 1475 | + { |
---|
| 1476 | + if (Globals.drawMode == CameraPane.SHADOW) |
---|
| 1477 | + gl.glDepthMask(material.opacity >= 0.9 && display.modelParams7[1] > 0.1); |
---|
| 1478 | + else |
---|
| 1479 | + gl.glDepthMask(material.opacity >= 0.99); |
---|
| 1480 | + } |
---|
208 | 1481 | } |
---|
209 | 1482 | |
---|
210 | 1483 | int matrixdepth = 0; // 10000; // CONFLICT WITH cMESH... WARNING WARNING WARNING WARNING WARNING WARNING !!!!!!!!!!!! 0; |
---|
.. | .. |
---|
225 | 1498 | currentGL.glMultMatrixd(model, 0); |
---|
226 | 1499 | } |
---|
227 | 1500 | |
---|
228 | | - void PushMatrix(double[][] matrix, int count) |
---|
| 1501 | + public void PushMatrix(double[][] matrix, int count) // INTERFACE |
---|
229 | 1502 | { |
---|
230 | 1503 | matrixdepth++; |
---|
231 | 1504 | // GrafreeD.tracein(matrix); |
---|
.. | .. |
---|
270 | 1543 | |
---|
271 | 1544 | double[][] tmpmat = new double[4][4]; |
---|
272 | 1545 | |
---|
273 | | - void PopMatrix(double[][] inverse) |
---|
| 1546 | + public void PopMatrix(double[][] inverse) // INTERFACE |
---|
274 | 1547 | { |
---|
275 | 1548 | --matrixdepth; |
---|
276 | 1549 | |
---|
.. | .. |
---|
310 | 1583 | PushTextureMatrix(matrix, 1); |
---|
311 | 1584 | } |
---|
312 | 1585 | |
---|
313 | | - void PushTextureMatrix(double[][] matrix, int count) |
---|
| 1586 | + public void PushTextureMatrix(double[][] matrix, int count) // INTERFACE |
---|
314 | 1587 | { |
---|
315 | 1588 | currentGL.glActiveTexture(GetGL().GL_TEXTURE0); |
---|
316 | 1589 | |
---|
.. | .. |
---|
324 | 1597 | currentGL.glMatrixMode(GetGL().GL_MODELVIEW); |
---|
325 | 1598 | } |
---|
326 | 1599 | |
---|
327 | | - void PopTextureMatrix(double[][] inverse) |
---|
| 1600 | + public void PopTextureMatrix(double[][] inverse) // INTERFACE |
---|
328 | 1601 | { |
---|
329 | 1602 | currentGL.glActiveTexture(GetGL().GL_TEXTURE0); |
---|
330 | 1603 | currentGL.glMatrixMode(GetGL().GL_TEXTURE); |
---|
.. | .. |
---|
356 | 1629 | // may 2014 if (cam == cameras[0] || cam == cameras[1]) |
---|
357 | 1630 | // return false; |
---|
358 | 1631 | |
---|
359 | | - if (REFUSEMODE && isLIVE() && camerachangeframe != 0 && camerachangeframe != framecount) |
---|
| 1632 | + if (REFUSEMODE && Globals.isLIVE() && camerachangeframe != 0 && camerachangeframe != Globals.framecount) |
---|
360 | 1633 | { |
---|
361 | 1634 | // check for last change |
---|
362 | | - if (framecount < camerachangeframe + 400) // 120 == 1 second |
---|
| 1635 | + if (Globals.framecount < camerachangeframe + 400) // 120 == 1 second |
---|
363 | 1636 | { |
---|
364 | 1637 | // refuse the camera change |
---|
365 | 1638 | System.err.println("Camera " + cam + " REFUSED"); |
---|
.. | .. |
---|
367 | 1640 | } |
---|
368 | 1641 | } |
---|
369 | 1642 | |
---|
370 | | - camerachangeframe = framecount; |
---|
| 1643 | + camerachangeframe = Globals.framecount; |
---|
371 | 1644 | |
---|
372 | 1645 | cam.hAspect = -1; // Read only |
---|
373 | 1646 | |
---|
.. | .. |
---|
398 | 1671 | { |
---|
399 | 1672 | //System.err.println("Oeil on"); |
---|
400 | 1673 | TRACK = true; |
---|
401 | | -// JUNE 2014 if (TRACK && trackedobject != null && drawMode == SHADOW) // && !lightMode) |
---|
| 1674 | +// JUNE 2014 if (TRACK && trackedobject != null && DrawMode() == SHADOW) // && !lightMode) |
---|
402 | 1675 | // object.editWindow.ScreenFit(trackedobject); |
---|
403 | 1676 | //pingthread.StepToTarget(true); |
---|
404 | 1677 | } |
---|
.. | .. |
---|
407 | 1680 | { |
---|
408 | 1681 | //System.err.println("Oeil on"); |
---|
409 | 1682 | OEIL = true; |
---|
410 | | - if ((TRACK || SHADOWTRACK) && trackedobject != null && drawMode == SHADOW) // && !lightMode) |
---|
| 1683 | + if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode) |
---|
411 | 1684 | object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
412 | 1685 | //pingthread.StepToTarget(true); |
---|
413 | 1686 | } |
---|
.. | .. |
---|
471 | 1744 | { |
---|
472 | 1745 | frozen ^= true; |
---|
473 | 1746 | // Weird... |
---|
474 | | - lighttouched = true; |
---|
| 1747 | + Globals.lighttouched = true; |
---|
475 | 1748 | } |
---|
476 | 1749 | |
---|
477 | 1750 | void ToggleDL() |
---|
.. | .. |
---|
486 | 1759 | |
---|
487 | 1760 | void ToggleLive() |
---|
488 | 1761 | { |
---|
489 | | - setLIVE(isLIVE() ^ true); |
---|
| 1762 | + Globals.setLIVE(Globals.isLIVE() ^ true); |
---|
490 | 1763 | |
---|
491 | | - System.err.println("LIVE = " + isLIVE()); |
---|
| 1764 | + System.err.println("LIVE = " + Globals.isLIVE()); |
---|
492 | 1765 | |
---|
493 | | - if (!isLIVE()) // save sound |
---|
| 1766 | + if (!Globals.isLIVE()) // save sound |
---|
494 | 1767 | GrafreeD.savesound = true; // wav.save(); |
---|
495 | 1768 | // else |
---|
496 | 1769 | repaint(); // start loop // may 2013 |
---|
.. | .. |
---|
513 | 1786 | |
---|
514 | 1787 | void ToggleCrowd() |
---|
515 | 1788 | { |
---|
516 | | - CROWD ^= true; |
---|
| 1789 | + Globals.CROWD ^= true; |
---|
517 | 1790 | } |
---|
518 | 1791 | |
---|
519 | 1792 | void ToggleInertia() |
---|
.. | .. |
---|
674 | 1947 | lightCamera = cam; |
---|
675 | 1948 | } |
---|
676 | 1949 | |
---|
677 | | - CameraPane(Object3D o, Camera cam, boolean withcontext) |
---|
678 | | - { |
---|
679 | | - super(defaultcaps, null, withcontext?glcontext:null, null); |
---|
680 | | - |
---|
681 | | - //System.out.println("AMERICA AREA = " + (9458886 + 9210755 + 8480395 + 2736391 + 1943018 + 1289475 + 1141569 + 1069350 + 911559 + 721229 + 395886 + 377972 + 246700 + 211156 + 173985 + 141133 + 118279 + 112079 + 108523)); |
---|
682 | | - glcontext = getContext(); |
---|
683 | | - |
---|
684 | | - cameras = new Camera[2]; |
---|
685 | | - targetLookAts = new cVector[2]; |
---|
686 | | - |
---|
687 | | - SetCamera(cam); |
---|
688 | | - |
---|
689 | | - SetLight(new Camera(new cVector(10, 10, -20))); |
---|
690 | | - |
---|
691 | | - object = o; |
---|
692 | | - |
---|
693 | | - setBackground(Color.white); |
---|
694 | | - |
---|
695 | | - addKeyListener(this); |
---|
696 | | - addMouseListener(this); |
---|
697 | | - addMouseMotionListener(this); |
---|
698 | | - addMouseWheelListener(this); |
---|
699 | | - //System.out.println("addGLEventListener: " + this); |
---|
700 | | - addGLEventListener(this); |
---|
701 | | - |
---|
702 | | -// pingthread.start(); // may 2013 |
---|
703 | | - } |
---|
704 | | - |
---|
705 | 1950 | private static void ApplyTransform(GL gl, Mat4f xform) |
---|
706 | 1951 | { |
---|
707 | 1952 | float[] data = new float[16]; |
---|
.. | .. |
---|
759 | 2004 | |
---|
760 | 2005 | GL currentGL; |
---|
761 | 2006 | |
---|
762 | | - GL GetGL() |
---|
| 2007 | + public GL GetGL() // INTERFACE |
---|
763 | 2008 | { |
---|
764 | 2009 | return currentGL; |
---|
765 | 2010 | } |
---|
.. | .. |
---|
6271 | 7516 | return null; |
---|
6272 | 7517 | } |
---|
6273 | 7518 | |
---|
6274 | | - void ReleaseTextures(cTexture tex) |
---|
| 7519 | + public void ReleaseTextures(cTexture tex) // INTERFACE |
---|
6275 | 7520 | { |
---|
6276 | 7521 | if (/*tex == null ||*/ ambientOcclusion ) // || !textureon) |
---|
6277 | 7522 | { |
---|
.. | .. |
---|
6309 | 7554 | |
---|
6310 | 7555 | void ReleaseTexture(String tex, boolean bump) |
---|
6311 | 7556 | { |
---|
6312 | | - if (// drawMode != 0 || /*tex == null ||*/ |
---|
| 7557 | + if (// DrawMode() != 0 || /*tex == null ||*/ |
---|
6313 | 7558 | ambientOcclusion ) // || !textureon) |
---|
6314 | 7559 | { |
---|
6315 | 7560 | return; |
---|
.. | .. |
---|
6410 | 7655 | } |
---|
6411 | 7656 | } |
---|
6412 | 7657 | |
---|
6413 | | - /*boolean*/ void BindTextures(cTexture tex, int resolution) |
---|
| 7658 | + /*boolean*/ public void BindTextures(cTexture tex, int resolution) // INTERFACE |
---|
6414 | 7659 | { |
---|
6415 | | - if (// drawMode != 0 || /*tex == null ||*/ |
---|
| 7660 | + if (// DrawMode() != 0 || /*tex == null ||*/ |
---|
6416 | 7661 | ambientOcclusion ) // || !textureon) |
---|
6417 | 7662 | { |
---|
6418 | 7663 | return; // false; |
---|
.. | .. |
---|
7312 | 8557 | static boolean occlusionInitialized = false; |
---|
7313 | 8558 | boolean selection = false; |
---|
7314 | 8559 | boolean pointselection = false; |
---|
7315 | | - /*static*/ boolean lighttouched = true; |
---|
| 8560 | + ///*static*/ boolean lighttouched = true; |
---|
7316 | 8561 | boolean deselect; |
---|
7317 | | - boolean ambientOcclusion = false; |
---|
| 8562 | + private boolean ambientOcclusion = false; |
---|
7318 | 8563 | static boolean flash = false; |
---|
7319 | 8564 | /*static*/ boolean wait = false; |
---|
7320 | 8565 | boolean displaydone = false; // after repaint() calls |
---|
.. | .. |
---|
7444 | 8689 | //gl.glFrustum(-0.5*scale, 0.5*scale, -0.5*scale, 0.5*scale, 1, 100); |
---|
7445 | 8690 | //glu.gluPerspective(lightshaper_fovy, 1, lightshaper_zNear, lightshaper_zFar); |
---|
7446 | 8691 | double scale = lightCamera.SCALE / lightCamera.Distance(); |
---|
| 8692 | +// PATCH FILLE AUX JEANS |
---|
| 8693 | + //scale *= lightCamera.shaper_fovy / 25; |
---|
7447 | 8694 | gl.glScaled(2 * scale, 2 * scale, -scale); |
---|
7448 | 8695 | gl.glTranslated(0, 0, lightCamera.DECAL); |
---|
7449 | 8696 | |
---|
.. | .. |
---|
7601 | 8848 | |
---|
7602 | 8849 | boolean restartframe = false; |
---|
7603 | 8850 | |
---|
7604 | | - static int framecount = 0; // general-purpose global count |
---|
7605 | | - |
---|
7606 | 8851 | void displayAntiAliased(javax.media.opengl.GL gl) |
---|
7607 | 8852 | { |
---|
7608 | 8853 | //gl.glGetIntegerv(gl.GL_ACCUM_RED_BITS, viewport, 0); |
---|
.. | .. |
---|
7633 | 8878 | gl.glClear(gl.GL_ACCUM_BUFFER_BIT); |
---|
7634 | 8879 | for (jitter = 0; jitter < ACSIZE; jitter++) //, GrafreeD.wav.cursor += LIVE ? 735 : 0) |
---|
7635 | 8880 | { |
---|
7636 | | - framecount++; |
---|
| 8881 | + Globals.framecount++; |
---|
7637 | 8882 | |
---|
7638 | 8883 | if (CameraPane.tickcount > 0) |
---|
7639 | 8884 | CameraPane.tickcount--; |
---|
.. | .. |
---|
7671 | 8916 | |
---|
7672 | 8917 | gl.glLightfv(gl.GL_LIGHT0, gl.GL_POSITION, pos, 0); |
---|
7673 | 8918 | */ |
---|
7674 | | - lighttouched = true; |
---|
| 8919 | + Globals.lighttouched = true; |
---|
7675 | 8920 | //System.err.println(" shadowbuffer: " + jitter); |
---|
7676 | 8921 | shadowbuffer.display(); |
---|
7677 | 8922 | |
---|
.. | .. |
---|
8618 | 9863 | } |
---|
8619 | 9864 | } |
---|
8620 | 9865 | |
---|
8621 | | - boolean IsFrozen() |
---|
8622 | | - { |
---|
8623 | | - boolean selectmode = drawMode == SELECTION || CameraPane.DEBUG_SELECTION; |
---|
8624 | | - |
---|
8625 | | - return !selectmode && cameracount == 0; // != 0; |
---|
8626 | | - } |
---|
8627 | | - |
---|
8628 | 9866 | boolean niceon = false; |
---|
8629 | 9867 | javax.swing.Timer AAtimer = new javax.swing.Timer(750, this); |
---|
8630 | 9868 | boolean currentlydrawing = false; |
---|
.. | .. |
---|
8642 | 9880 | } |
---|
8643 | 9881 | // if (DEBUG_SELECTION) |
---|
8644 | 9882 | // { |
---|
8645 | | -// if (drawMode != SELECTION) |
---|
8646 | | -// drawMode = SELECTION; |
---|
| 9883 | +// if (DrawMode() != SELECTION) |
---|
| 9884 | +// DrawMode() = SELECTION; |
---|
8647 | 9885 | // } |
---|
8648 | 9886 | |
---|
8649 | 9887 | if (!isRenderer) |
---|
.. | .. |
---|
8699 | 9937 | |
---|
8700 | 9938 | //ANTIALIAS = 0; |
---|
8701 | 9939 | |
---|
8702 | | - if (drawMode == DEFAULT) // && CURRENTANTIALIAS > 0) |
---|
| 9940 | + if (DrawMode() == DEFAULT) // && CURRENTANTIALIAS > 0) |
---|
8703 | 9941 | { |
---|
8704 | | - if (niceon || isLIVE()) |
---|
| 9942 | + if (niceon || Globals.isLIVE()) |
---|
8705 | 9943 | { |
---|
8706 | 9944 | //if(active == 0) |
---|
8707 | 9945 | // antialiaser = null; |
---|
.. | .. |
---|
8726 | 9964 | assert eyeCamera.shaper_zFar == 1E5f; // 500.0f; |
---|
8727 | 9965 | */ |
---|
8728 | 9966 | |
---|
8729 | | - if (drawMode == DEFAULT) |
---|
| 9967 | + if (DrawMode() == DEFAULT) |
---|
8730 | 9968 | { |
---|
8731 | 9969 | currentlydrawing = true; |
---|
8732 | 9970 | } |
---|
.. | .. |
---|
8757 | 9995 | |
---|
8758 | 9996 | // if(Applet3D.clipboard != null) |
---|
8759 | 9997 | // System.out.println("Clipboard = " + Applet3D.clipboard); //.get(0).parent); |
---|
8760 | | -//drawMode = SELECTION; |
---|
| 9998 | +//DrawMode() = SELECTION; |
---|
8761 | 9999 | indexcount = 0; |
---|
8762 | 10000 | |
---|
8763 | | - if (drawMode == OCCLUSION) |
---|
| 10001 | + if (DrawMode() == OCCLUSION) |
---|
8764 | 10002 | { |
---|
8765 | | - drawMode = DEFAULT; |
---|
| 10003 | + Globals.drawMode = DEFAULT; // WARNING |
---|
8766 | 10004 | ambientOcclusion = true; |
---|
8767 | 10005 | setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); |
---|
8768 | 10006 | Object3D theobject = object; |
---|
.. | .. |
---|
8781 | 10019 | ambientOcclusion = false; |
---|
8782 | 10020 | } |
---|
8783 | 10021 | |
---|
8784 | | - if (lighttouched && drawMode == DEFAULT && !lightMode) // && !FROZEN) |
---|
| 10022 | + if (Globals.lighttouched && DrawMode() == DEFAULT && !lightMode) // && !FROZEN) |
---|
8785 | 10023 | { |
---|
8786 | 10024 | //if (RENDERSHADOW) // ? |
---|
8787 | 10025 | if (!IsFrozen()) |
---|
8788 | 10026 | { |
---|
8789 | 10027 | // dec 2012 |
---|
8790 | | - if (!ambientOcclusion && !(!flash && !lightMode && drawMode == DEFAULT && ANTIALIAS > 0)) |
---|
| 10028 | + if (!ambientOcclusion && !(!flash && !lightMode && DrawMode() == DEFAULT && ANTIALIAS > 0)) |
---|
8791 | 10029 | { |
---|
8792 | | - framecount++; |
---|
| 10030 | + Globals.framecount++; |
---|
8793 | 10031 | shadowbuffer.display(); |
---|
8794 | 10032 | } |
---|
8795 | 10033 | } |
---|
8796 | | - lighttouched = false; // ?? |
---|
| 10034 | + Globals.lighttouched = false; // ?? |
---|
8797 | 10035 | //drawing = true; |
---|
8798 | 10036 | //lighttouched = true; |
---|
8799 | 10037 | } |
---|
.. | .. |
---|
8814 | 10052 | //eyeCamera.shaper_fovy = 1; |
---|
8815 | 10053 | } |
---|
8816 | 10054 | |
---|
8817 | | - if ((RENDERPROGRAM != 0 || ambientOcclusion || spherical) && drawMode == DEFAULT) // SELECTION) |
---|
| 10055 | + if ((RENDERPROGRAM != 0 || ambientOcclusion || spherical) && DrawMode() == DEFAULT) // SELECTION) |
---|
8818 | 10056 | { |
---|
8819 | | - //System.out.println("drawMode = " + drawMode); |
---|
| 10057 | + //System.out.println("DrawMode() = " + DrawMode()); |
---|
8820 | 10058 | vertexMode |= VP_PASS; |
---|
8821 | 10059 | //vertexMode |= VP_PROJECTION; |
---|
8822 | 10060 | if (!ambientOcclusion) |
---|
.. | .. |
---|
8876 | 10114 | Camera cam = renderCamera; // lightMode?lightCamera:eyeCamera; |
---|
8877 | 10115 | //Camera lightcam = new Camera(light0); |
---|
8878 | 10116 | |
---|
8879 | | - if (drawMode == SHADOW) |
---|
| 10117 | + if (DrawMode() == SHADOW) |
---|
8880 | 10118 | { |
---|
8881 | 10119 | /* |
---|
8882 | 10120 | gl.glMatrixMode(GL.GL_MODELVIEW); |
---|
.. | .. |
---|
8966 | 10204 | gl.glClear(gl.GL_DEPTH_BUFFER_BIT); |
---|
8967 | 10205 | } else |
---|
8968 | 10206 | { |
---|
8969 | | - if (drawMode != DEFAULT) |
---|
| 10207 | + if (DrawMode() != DEFAULT) |
---|
8970 | 10208 | { |
---|
8971 | 10209 | gl.glClearColor(1, 1, 1, 0); |
---|
8972 | 10210 | } // 1); |
---|
.. | .. |
---|
9031 | 10269 | |
---|
9032 | 10270 | fast &= !ambientOcclusion; |
---|
9033 | 10271 | |
---|
9034 | | - if (drawMode == DEFAULT) |
---|
| 10272 | + if (DrawMode() == DEFAULT) |
---|
9035 | 10273 | { |
---|
9036 | 10274 | //gl.glEnable(gl.GL_ALPHA_TEST); |
---|
9037 | 10275 | //gl.glActiveTexture(GL.GL_TEXTURE0); |
---|
.. | .. |
---|
9092 | 10330 | //gl.glFrustum(-0.5*scale, 0.5*scale, -0.5*scale, 0.5*scale, 1, 100); |
---|
9093 | 10331 | //glu.gluPerspective(lightshaper_fovy, 1, lightshaper_zNear, lightshaper_zFar); |
---|
9094 | 10332 | double scale = lightCamera.SCALE / lightCamera.Distance(); |
---|
| 10333 | +// PATCH FILLE AUX JEANS |
---|
| 10334 | + //scale *= lightCamera.shaper_fovy / 25; |
---|
9095 | 10335 | gl.glScaled(2 * scale, 2 * scale, -scale); |
---|
9096 | 10336 | gl.glTranslated(0, 0, lightCamera.DECAL); |
---|
9097 | 10337 | |
---|
.. | .. |
---|
9227 | 10467 | gl.glMatrixMode(gl.GL_PROJECTION); |
---|
9228 | 10468 | gl.glLoadIdentity(); |
---|
9229 | 10469 | |
---|
9230 | | - if (drawMode == SHADOW || cam == lightCamera) // || (vertexMode&VP_PROJECTION) != 0) |
---|
| 10470 | + if (DrawMode() == SHADOW || cam == lightCamera) // || (vertexMode&VP_PROJECTION) != 0) |
---|
9231 | 10471 | { |
---|
9232 | 10472 | //glu.gluPerspective(lightshaper_fovy, 1, lightshaper_zNear, lightshaper_zFar); |
---|
9233 | 10473 | double scale = lightCamera.SCALE / lightCamera.Distance(); |
---|
| 10474 | +// PATCH FILLE AUX JEANS |
---|
| 10475 | + //scale *= lightCamera.shaper_fovy / 25; |
---|
9234 | 10476 | gl.glScaled(2 * scale, 2 * scale, -scale); |
---|
9235 | 10477 | gl.glTranslated(0, 0, lightCamera.DECAL); |
---|
9236 | 10478 | //System.out.println("DECAL = " + LIGHTDECAL + "; SCALE = " + LIGHTSCALE); |
---|
.. | .. |
---|
9283 | 10525 | //gl.glPushMatrix(); |
---|
9284 | 10526 | gl.glLoadIdentity(); |
---|
9285 | 10527 | |
---|
9286 | | - if (!ambientOcclusion) // drawMode != OCCLUSION) |
---|
| 10528 | + if (!ambientOcclusion) // DrawMode() != OCCLUSION) |
---|
9287 | 10529 | { |
---|
9288 | 10530 | //LA.xformPos(light0, lightCamera.fromScreen, light); |
---|
9289 | 10531 | LA.xformDir(dirlight, lightCamera.fromScreen, lightposition); |
---|
.. | .. |
---|
9370 | 10612 | } |
---|
9371 | 10613 | |
---|
9372 | 10614 | /**/ |
---|
9373 | | - if (true) // drawMode == SELECTION) // != DEFAULT) |
---|
| 10615 | + if (true) // DrawMode() == SELECTION) // != DEFAULT) |
---|
9374 | 10616 | gl.glDisable(gl.GL_LIGHTING); |
---|
9375 | 10617 | else |
---|
9376 | 10618 | gl.glEnable(gl.GL_LIGHTING); |
---|
.. | .. |
---|
9388 | 10630 | |
---|
9389 | 10631 | lightslot = 64; |
---|
9390 | 10632 | |
---|
9391 | | - if (!frozen && !ambientOcclusion && isRenderer && drawMode == DEFAULT) |
---|
| 10633 | + if (!frozen && !ambientOcclusion && isRenderer && DrawMode() == DEFAULT) |
---|
9392 | 10634 | { |
---|
9393 | 10635 | DrawLights(object); |
---|
9394 | 10636 | } |
---|
.. | .. |
---|
9399 | 10641 | fragmentMode |= (lightslot - 64) << 2; // 1; // first bit is available for aniso |
---|
9400 | 10642 | //System.out.println("fragmentMode = " + fragmentMode); |
---|
9401 | 10643 | |
---|
9402 | | - if (drawMode == DEFAULT || drawMode == SELECTION || DEBUG_SELECTION) |
---|
| 10644 | + if (DrawMode() == DEFAULT || DrawMode() == SELECTION || IsDebugSelection()) |
---|
9403 | 10645 | { |
---|
9404 | 10646 | /* |
---|
9405 | 10647 | if (CULLFACE || (ambientOcclusion && OCCLUSION_CULLING)) |
---|
.. | .. |
---|
9432 | 10674 | } |
---|
9433 | 10675 | } |
---|
9434 | 10676 | |
---|
9435 | | - if (drawMode == DEFAULT) |
---|
| 10677 | + if (DrawMode() == DEFAULT) |
---|
9436 | 10678 | { |
---|
9437 | 10679 | if (WIREFRAME && !ambientOcclusion) |
---|
9438 | 10680 | { |
---|
.. | .. |
---|
9450 | 10692 | gl.glDisable(GL.GL_FRAGMENT_PROGRAM_ARB); |
---|
9451 | 10693 | gl.glDisable(GL.GL_VERTEX_PROGRAM_ARB); |
---|
9452 | 10694 | |
---|
9453 | | - if (!fast/*RENDERPROGRAM != 0*/ && (drawMode == DEFAULT || drawMode == SHADOW)) // && !WIREFRAME) // |
---|
| 10695 | + if (!fast/*RENDERPROGRAM != 0*/ && (DrawMode() == DEFAULT || DrawMode() == SHADOW)) // && !WIREFRAME) // |
---|
9454 | 10696 | { |
---|
9455 | 10697 | if (vertexMode != 0) // && !fast) |
---|
9456 | 10698 | { |
---|
.. | .. |
---|
9470 | 10712 | } |
---|
9471 | 10713 | } |
---|
9472 | 10714 | |
---|
9473 | | - if (false) // fast && !IsFreezed() && drawMode != SELECTION && !ambientOcclusion) |
---|
| 10715 | + if (false) // fast && !IsFreezed() && DrawMode() != SELECTION && !ambientOcclusion) |
---|
9474 | 10716 | { |
---|
9475 | 10717 | //gl.glDepthFunc(GL.GL_LEQUAL); |
---|
9476 | 10718 | //gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT); |
---|
.. | .. |
---|
9498 | 10740 | //gl.glDepthMask(false); |
---|
9499 | 10741 | } |
---|
9500 | 10742 | |
---|
9501 | | - if (false) // drawMode == SHADOW) |
---|
| 10743 | + if (false) // DrawMode() == SHADOW) |
---|
9502 | 10744 | { |
---|
9503 | 10745 | //SetColumnMajorData(cameraInverseTransform, view_1); |
---|
9504 | 10746 | //System.out.println("light = " + cameraInverseTransform); |
---|
.. | .. |
---|
9512 | 10754 | //System.out.println("object = " + object); |
---|
9513 | 10755 | if (!frozen && !imageLocked) |
---|
9514 | 10756 | { |
---|
9515 | | - if (!flash && !lightMode && drawMode == DEFAULT && ANTIALIAS > 0) |
---|
| 10757 | + if (!flash && !lightMode && DrawMode() == DEFAULT && ANTIALIAS > 0) |
---|
9516 | 10758 | { |
---|
9517 | 10759 | displayAntiAliased(gl); |
---|
9518 | 10760 | } else |
---|
9519 | 10761 | { |
---|
9520 | 10762 | programcount = 0; |
---|
9521 | | - int keepmode = drawMode; |
---|
| 10763 | + int keepmode = DrawMode(); |
---|
9522 | 10764 | // if (DEBUG_SELECTION) |
---|
9523 | 10765 | // { |
---|
9524 | | -// drawMode = SELECTION; |
---|
| 10766 | +// DrawMode() = SELECTION; |
---|
9525 | 10767 | // } |
---|
9526 | 10768 | // for point selection |
---|
9527 | 10769 | // gl.glGetDoublev(gl.GL_MODELVIEW_MATRIX, tempmat, 0); |
---|
.. | .. |
---|
9531 | 10773 | DrawObject(gl); |
---|
9532 | 10774 | |
---|
9533 | 10775 | // jan 2013 System.err.println("RESET ABORT (display)"); |
---|
9534 | | - // if (drawMode == DEFAULT) |
---|
| 10776 | + // if (DrawMode() == DEFAULT) |
---|
9535 | 10777 | // ABORTED = false; |
---|
9536 | 10778 | fullreset = false; |
---|
9537 | | - drawMode = keepmode; |
---|
| 10779 | + Globals.drawMode = keepmode; // WARNING |
---|
9538 | 10780 | //System.out.println("PROGRAM SWITCH " + programcount); |
---|
9539 | 10781 | } |
---|
9540 | 10782 | } |
---|
.. | .. |
---|
9542 | 10784 | gl.glDisable(GL.GL_VERTEX_PROGRAM_ARB); |
---|
9543 | 10785 | gl.glDisable(GL.GL_FRAGMENT_PROGRAM_ARB); |
---|
9544 | 10786 | |
---|
9545 | | - if (drawMode == DEFAULT) |
---|
| 10787 | + if (DrawMode() == DEFAULT) |
---|
9546 | 10788 | { |
---|
9547 | 10789 | ReleaseTexture(NOISE_TEXTURE, false); |
---|
9548 | 10790 | } |
---|
9549 | | - //if (drawMode == DEFAULT) |
---|
| 10791 | + //if (DrawMode() == DEFAULT) |
---|
9550 | 10792 | { |
---|
9551 | 10793 | |
---|
9552 | 10794 | gl.glActiveTexture(GL.GL_TEXTURE1); |
---|
.. | .. |
---|
9558 | 10800 | //else |
---|
9559 | 10801 | //gl.glDisable(gl.GL_TEXTURE_2D); |
---|
9560 | 10802 | //gl.glPopMatrix(); |
---|
9561 | | - if (imageCompleted && ANTIALIAS > 0 && drawMode == DEFAULT && cam != lightCamera && !ambientOcclusion) |
---|
| 10803 | + if (imageCompleted && ANTIALIAS > 0 && DrawMode() == DEFAULT && cam != lightCamera && !ambientOcclusion) |
---|
9562 | 10804 | { |
---|
9563 | 10805 | //new Exception().printStackTrace(); |
---|
9564 | 10806 | //System.out.println("Draw image " + width + ", " + height); |
---|
.. | .. |
---|
9600 | 10842 | //gl.glFlush(); |
---|
9601 | 10843 | } |
---|
9602 | 10844 | |
---|
9603 | | - if (flash && drawMode == DEFAULT) |
---|
| 10845 | + if (flash && DrawMode() == DEFAULT) |
---|
9604 | 10846 | { |
---|
9605 | 10847 | flash = false; |
---|
9606 | 10848 | wait = true; |
---|
.. | .. |
---|
9608 | 10850 | } |
---|
9609 | 10851 | |
---|
9610 | 10852 | //drawing = false; |
---|
9611 | | - //if(drawMode == DEFAULT) |
---|
| 10853 | + //if(DrawMode() == DEFAULT) |
---|
9612 | 10854 | // niceon = false; |
---|
9613 | | - if (drawMode == DEFAULT) |
---|
| 10855 | + if (DrawMode() == DEFAULT) |
---|
9614 | 10856 | { |
---|
9615 | 10857 | currentlydrawing = false; |
---|
9616 | 10858 | } |
---|
.. | .. |
---|
9630 | 10872 | repaint(); |
---|
9631 | 10873 | } |
---|
9632 | 10874 | |
---|
9633 | | - if (isLIVE() && drawMode == DEFAULT) // may 2013 |
---|
| 10875 | + if (Globals.isLIVE() && DrawMode() == DEFAULT) // may 2013 |
---|
9634 | 10876 | repaint(); |
---|
9635 | 10877 | |
---|
9636 | 10878 | displaydone = true; |
---|
.. | .. |
---|
9667 | 10909 | if (GrafreeD.RENDERME > 0) |
---|
9668 | 10910 | GrafreeD.RENDERME--; // mechante magouille |
---|
9669 | 10911 | |
---|
9670 | | - ONESTEP = false; |
---|
| 10912 | + Globals.ONESTEP = false; |
---|
9671 | 10913 | } |
---|
9672 | 10914 | |
---|
9673 | 10915 | static boolean zoomonce = false; |
---|
.. | .. |
---|
9675 | 10917 | void DrawObject(GL gl, boolean draw) |
---|
9676 | 10918 | { |
---|
9677 | 10919 | //System.out.println("DRAW OBJECT " + mouseDown); |
---|
9678 | | -// drawMode = SELECTION; |
---|
| 10920 | +// DrawMode() = SELECTION; |
---|
9679 | 10921 | //GL gl = getGL(); |
---|
9680 | 10922 | if ((TRACK || SHADOWTRACK) || zoomonce) |
---|
9681 | 10923 | { |
---|
9682 | | - if ((TRACK || SHADOWTRACK) && trackedobject != null && drawMode == SHADOW) // && !lightMode) |
---|
| 10924 | + if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode) |
---|
9683 | 10925 | object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
9684 | 10926 | pingthread.StepToTarget(true); // true); |
---|
9685 | 10927 | // zoomonce = false; |
---|
.. | .. |
---|
9700 | 10942 | callist = gl.glGenLists(1); |
---|
9701 | 10943 | } |
---|
9702 | 10944 | |
---|
9703 | | - boolean selectmode = drawMode == SELECTION || CameraPane.DEBUG_SELECTION; |
---|
| 10945 | + boolean selectmode = DrawMode() == SELECTION || IsDebugSelection(); |
---|
9704 | 10946 | |
---|
9705 | | - boolean active = !selectmode; // drawMode != SELECTION; // mouseDown; |
---|
| 10947 | + boolean active = !selectmode; // DrawMode() != SELECTION; // mouseDown; |
---|
9706 | 10948 | |
---|
9707 | 10949 | if (!mainDL || !active || touched) |
---|
9708 | 10950 | { |
---|
.. | .. |
---|
9729 | 10971 | PushMatrix(ClickInfo.matbuffer); |
---|
9730 | 10972 | } |
---|
9731 | 10973 | |
---|
9732 | | - if (drawMode == 0) |
---|
| 10974 | + if (DrawMode() == 0) |
---|
9733 | 10975 | { |
---|
9734 | 10976 | // System.out.println("CLEAR +++++++++++++++ +++++++++++++++ +++++++++++++++ +++++++++++++++"); |
---|
9735 | 10977 | |
---|
.. | .. |
---|
9743 | 10985 | // DRAW |
---|
9744 | 10986 | object.draw(this, /*(Composite)*/ object, false, false); |
---|
9745 | 10987 | |
---|
9746 | | - if (drawMode == DEFAULT) |
---|
| 10988 | + if (DrawMode() == DEFAULT) |
---|
9747 | 10989 | { |
---|
9748 | 10990 | if (DEBUG) |
---|
9749 | 10991 | { |
---|
.. | .. |
---|
9754 | 10996 | selectedpoint.radius = radius; |
---|
9755 | 10997 | selectedpoint.recalculate(); |
---|
9756 | 10998 | selectedpoint.material = new cMaterial(); |
---|
9757 | | - selectedpoint.material.color = 0.15f; |
---|
| 10999 | + selectedpoint.material.color = 0.15f; // Yellow |
---|
9758 | 11000 | selectedpoint.material.modulation = 0.75f; |
---|
9759 | 11001 | |
---|
9760 | | - debugpoint.radius = radius; |
---|
9761 | | - debugpoint.recalculate(); |
---|
9762 | | - debugpoint.material = new cMaterial(); |
---|
9763 | | - debugpoint.material.color = 0.25f; |
---|
9764 | | - debugpoint.material.modulation = 0.75f; |
---|
| 11002 | + debugpointG.radius = radius; |
---|
| 11003 | + debugpointG.recalculate(); |
---|
| 11004 | + debugpointG.material = new cMaterial(); |
---|
| 11005 | + debugpointG.material.color = 0.25f; // Green |
---|
| 11006 | + debugpointG.material.modulation = 0.75f; |
---|
9765 | 11007 | |
---|
9766 | | - debugpoint2.radius = radius; |
---|
9767 | | - debugpoint2.recalculate(); |
---|
9768 | | - debugpoint2.material = new cMaterial(); |
---|
9769 | | - debugpoint2.material.color = 0.75f; |
---|
9770 | | - debugpoint2.material.modulation = 0.75f; |
---|
| 11008 | + debugpointP.radius = radius; |
---|
| 11009 | + debugpointP.recalculate(); |
---|
| 11010 | + debugpointP.material = new cMaterial(); |
---|
| 11011 | + debugpointP.material.color = 0.75f; // Purple |
---|
| 11012 | + debugpointP.material.modulation = 0.75f; |
---|
9771 | 11013 | |
---|
9772 | | - debugpoint3.radius = radius; |
---|
9773 | | - debugpoint3.recalculate(); |
---|
9774 | | - debugpoint3.material = new cMaterial(); |
---|
9775 | | - debugpoint3.material.color = 0.5f; |
---|
9776 | | - debugpoint3.material.modulation = 0.75f; |
---|
| 11014 | + debugpointC.radius = radius; |
---|
| 11015 | + debugpointC.recalculate(); |
---|
| 11016 | + debugpointC.material = new cMaterial(); |
---|
| 11017 | + debugpointC.material.color = 0.5f; // Cyan |
---|
| 11018 | + debugpointC.material.modulation = 0.75f; |
---|
9777 | 11019 | |
---|
9778 | | - debugpoint4.radius = radius; |
---|
9779 | | - debugpoint4.recalculate(); |
---|
9780 | | - debugpoint4.material = new cMaterial(); |
---|
9781 | | - debugpoint4.material.color = 0f; |
---|
9782 | | - debugpoint4.material.modulation = 0.75f; |
---|
| 11020 | + debugpointR.radius = radius; |
---|
| 11021 | + debugpointR.recalculate(); |
---|
| 11022 | + debugpointR.material = new cMaterial(); |
---|
| 11023 | + debugpointR.material.color = 0f; // Red |
---|
| 11024 | + debugpointR.material.modulation = 0.75f; |
---|
9783 | 11025 | |
---|
9784 | 11026 | InitPoints(radius); |
---|
9785 | 11027 | } |
---|
9786 | 11028 | selectedpoint.draw(this, /*(Composite)*/ null, false, false); |
---|
9787 | | - debugpoint.draw(this, /*(Composite)*/ null, false,false); |
---|
9788 | | - debugpoint2.draw(this, /*(Composite)*/ null, false,false); |
---|
9789 | | - debugpoint3.draw(this, /*(Composite)*/ null, false,false); |
---|
9790 | | - debugpoint4.draw(this, /*(Composite)*/ null, false,false); |
---|
| 11029 | + debugpointG.draw(this, /*(Composite)*/ null, false,false); |
---|
| 11030 | + debugpointP.draw(this, /*(Composite)*/ null, false,false); |
---|
| 11031 | + debugpointC.draw(this, /*(Composite)*/ null, false,false); |
---|
| 11032 | + debugpointR.draw(this, /*(Composite)*/ null, false,false); |
---|
9791 | 11033 | // DrawPoints(this); |
---|
9792 | 11034 | } |
---|
9793 | 11035 | |
---|
.. | .. |
---|
9795 | 11037 | } |
---|
9796 | 11038 | // GrafreeD.traceoff(); |
---|
9797 | 11039 | //System.out.println(stackdepth); |
---|
9798 | | - if (drawMode == 0) |
---|
| 11040 | + if (DrawMode() == 0) |
---|
9799 | 11041 | { |
---|
9800 | 11042 | ReleaseTextures(DEFAULT_TEXTURES); |
---|
9801 | 11043 | |
---|
.. | .. |
---|
9820 | 11062 | |
---|
9821 | 11063 | checker = null; |
---|
9822 | 11064 | |
---|
9823 | | - if (!ambientOcclusion && !IsFrozen() && drawMode == DEFAULT) |
---|
| 11065 | + if (!ambientOcclusion && !IsFrozen() && DrawMode() == DEFAULT) |
---|
9824 | 11066 | FindChecker(object); |
---|
9825 | 11067 | |
---|
9826 | | - if (checker != null && drawMode == DEFAULT) |
---|
| 11068 | + if (checker != null && DrawMode() == DEFAULT) |
---|
9827 | 11069 | { |
---|
9828 | | - // BindTexture(IMMORTAL_TEXTURE); |
---|
| 11070 | + //BindTexture(IMMORTAL_TEXTURE); |
---|
| 11071 | + BindTextures(checker.GetTextures(), checker.texres); |
---|
9829 | 11072 | // NEAREST |
---|
9830 | 11073 | GetGL().glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST); // GL.GL_LINEAR); |
---|
9831 | 11074 | DrawChecker(gl); |
---|
9832 | 11075 | //checker.Draw(this, null, false); |
---|
9833 | 11076 | // ReleaseTexture(IMMORTAL_TEXTURE); |
---|
| 11077 | + ReleaseTextures(checker.GetTextures()); |
---|
9834 | 11078 | } |
---|
9835 | 11079 | |
---|
9836 | 11080 | if (object.parent != null) |
---|
.. | .. |
---|
9843 | 11087 | //gl.glDisable(GL.GL_VERTEX_PROGRAM_ARB); |
---|
9844 | 11088 | //gl.glDisable(GL.GL_FRAGMENT_PROGRAM_ARB); |
---|
9845 | 11089 | |
---|
9846 | | - if (DISPLAYTEXT && drawMode == DEFAULT) |
---|
| 11090 | + if (DISPLAYTEXT && DrawMode() == DEFAULT) |
---|
9847 | 11091 | { |
---|
9848 | 11092 | // Draw it once, then use the raster |
---|
9849 | 11093 | Balloon(gl, balloon.createGraphics()); |
---|
.. | .. |
---|
9899 | 11143 | int[] xs = new int[3]; |
---|
9900 | 11144 | int[] ys = new int[3]; |
---|
9901 | 11145 | |
---|
9902 | | - void DrawString(Object3D obj) // String string) |
---|
| 11146 | + public void DrawString(Object3D obj) // String string) // INTERFACE |
---|
9903 | 11147 | { |
---|
9904 | | - if (!DISPLAYTEXT || drawMode != DEFAULT) |
---|
| 11148 | + if (!DISPLAYTEXT || DrawMode() != DEFAULT) |
---|
9905 | 11149 | { |
---|
9906 | 11150 | return; |
---|
9907 | 11151 | } |
---|
.. | .. |
---|
10388 | 11632 | "PARAM lodbias = { 10,10,10,10 };" + // 20, -2, -20, 1.0 };" + |
---|
10389 | 11633 | "PARAM infinity = { 100000000, 100000000, 100000000, 1.0 };" + |
---|
10390 | 11634 | "PARAM one2048th = { 0.00048828125, 0.00048828125, 0.00048828125, 1.0 };" + |
---|
| 11635 | + "PARAM ninetenth = { 0.9, 0.9, 0.9, 1.0 };" + |
---|
10391 | 11636 | "PARAM almostone = { 0.999, 0.999, 0.999, 1.0 };" + |
---|
10392 | 11637 | "PARAM c256 = { 256, 256, 256, 1.0 };" + |
---|
10393 | 11638 | "PARAM c256i = { 0.00390625, 0.00390625, 0.00390625, 1.0 };" + |
---|
.. | .. |
---|
11302 | 12547 | String Shadow(String depth, String shadow) |
---|
11303 | 12548 | { |
---|
11304 | 12549 | return "MAX temp.x, ndotl.x, one64th.x;" + |
---|
| 12550 | + "MIN temp.x, temp.x, ninetenth.x;" + |
---|
11305 | 12551 | /**/ |
---|
11306 | 12552 | // Sine |
---|
11307 | 12553 | "MUL temp.y, temp.x, temp.x;" + |
---|
.. | .. |
---|
11926 | 13172 | return; |
---|
11927 | 13173 | } |
---|
11928 | 13174 | |
---|
| 13175 | + boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK); |
---|
11929 | 13176 | |
---|
11930 | 13177 | // TIMER |
---|
11931 | | - if (!wheeltimer.isRunning() && e.getModifiersEx() == 0) // VR |
---|
| 13178 | + if (!wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR |
---|
11932 | 13179 | { |
---|
11933 | 13180 | keepboxmode = BOXMODE; |
---|
11934 | 13181 | keepsupport = SUPPORT; |
---|
.. | .. |
---|
12057 | 13304 | // ObjEditor.tweenManager.update(1f / 60f); |
---|
12058 | 13305 | |
---|
12059 | 13306 | // fev 2014??? |
---|
12060 | | - if ((TRACK || SHADOWTRACK) && trackedobject != null) // && drawMode == SHADOW) // && !lightMode) |
---|
| 13307 | + if ((TRACK || SHADOWTRACK) && trackedobject != null) // && DrawMode() == SHADOW) // && !lightMode) |
---|
12061 | 13308 | object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
12062 | 13309 | pingthread.StepToTarget(true); // true); |
---|
12063 | 13310 | } |
---|
.. | .. |
---|
12169 | 13416 | cVector tmp = new cVector(); |
---|
12170 | 13417 | cVector tmp2 = new cVector(); |
---|
12171 | 13418 | boolean isMoving; |
---|
| 13419 | + |
---|
| 13420 | + public cVector TargetLookAt() |
---|
| 13421 | + { |
---|
| 13422 | + return targetLookAt; |
---|
| 13423 | + } |
---|
12172 | 13424 | |
---|
12173 | 13425 | class PingThread extends Thread |
---|
12174 | 13426 | { |
---|
.. | .. |
---|
12308 | 13560 | //System.out.println("---------------- ---------- Paint " + tmp.length2()); |
---|
12309 | 13561 | if (lightMode) |
---|
12310 | 13562 | { |
---|
12311 | | - lighttouched = true; |
---|
| 13563 | + Globals.lighttouched = true; |
---|
12312 | 13564 | } |
---|
12313 | 13565 | |
---|
12314 | 13566 | if (OEILONCE && OEIL) |
---|
.. | .. |
---|
12366 | 13618 | mouseDown = false; |
---|
12367 | 13619 | if (lightMode) |
---|
12368 | 13620 | { |
---|
12369 | | - lighttouched = true; |
---|
| 13621 | + Globals.lighttouched = true; |
---|
12370 | 13622 | } |
---|
12371 | 13623 | repaint(); |
---|
12372 | 13624 | alreadypainted = true; |
---|
.. | .. |
---|
12374 | 13626 | isMoving = false; |
---|
12375 | 13627 | } //?? |
---|
12376 | 13628 | |
---|
12377 | | - if (isLIVE() && !alreadypainted) |
---|
| 13629 | + if (Globals.isLIVE() && !alreadypainted) |
---|
12378 | 13630 | { |
---|
12379 | 13631 | // FOR DEBUG BREAKPOINT USING PAUSE: while (true) |
---|
12380 | 13632 | repaint(); |
---|
.. | .. |
---|
12386 | 13638 | { |
---|
12387 | 13639 | if (lightMode) |
---|
12388 | 13640 | { |
---|
12389 | | - lighttouched = true; |
---|
| 13641 | + Globals.lighttouched = true; |
---|
12390 | 13642 | } |
---|
12391 | 13643 | drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS); |
---|
12392 | 13644 | } |
---|
.. | .. |
---|
12629 | 13881 | { |
---|
12630 | 13882 | manipCamera.Translate(dx, dy, getWidth()); |
---|
12631 | 13883 | } |
---|
| 13884 | + else |
---|
12632 | 13885 | if ((mouseMode & ZOOM) == 0 && (mouseMode & VR) != 0) |
---|
12633 | 13886 | { |
---|
12634 | 13887 | manipCamera.RotateInterest(dx, dy); |
---|
.. | .. |
---|
12639 | 13892 | |
---|
12640 | 13893 | if (manipCamera == lightCamera) |
---|
12641 | 13894 | { |
---|
12642 | | - lighttouched = true; |
---|
| 13895 | + Globals.lighttouched = true; |
---|
12643 | 13896 | } |
---|
12644 | 13897 | /* |
---|
12645 | 13898 | switch (mode) |
---|
.. | .. |
---|
12862 | 14115 | } |
---|
12863 | 14116 | if ((modifiers & CTRLCLICK) == CTRLCLICK) |
---|
12864 | 14117 | { |
---|
12865 | | - mouseMode |= SELECT; // BACKFORTH; |
---|
| 14118 | + mouseMode |= SELECT; |
---|
12866 | 14119 | } |
---|
12867 | 14120 | if ((modifiers & COMMAND) == COMMAND) |
---|
12868 | 14121 | { |
---|
.. | .. |
---|
13027 | 14280 | case 'B': |
---|
13028 | 14281 | BRISMOOTH ^= true; |
---|
13029 | 14282 | SHADOWCULLFACE ^= true; |
---|
13030 | | - lighttouched = true; |
---|
| 14283 | + Globals.lighttouched = true; |
---|
13031 | 14284 | repaint(); |
---|
13032 | 14285 | break; |
---|
13033 | 14286 | case 'b': |
---|
.. | .. |
---|
13127 | 14380 | repaint(); |
---|
13128 | 14381 | break; |
---|
13129 | 14382 | case 'O': |
---|
13130 | | - drawMode = OCCLUSION; |
---|
| 14383 | + Globals.drawMode = OCCLUSION; // WARNING |
---|
13131 | 14384 | repaint(); |
---|
13132 | 14385 | break; |
---|
13133 | 14386 | case 'o': |
---|
.. | .. |
---|
13218 | 14471 | break; |
---|
13219 | 14472 | case ' ': |
---|
13220 | 14473 | lightMode ^= true; |
---|
13221 | | - lighttouched = true; |
---|
| 14474 | + Globals.lighttouched = true; |
---|
13222 | 14475 | manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera; |
---|
13223 | 14476 | targetLookAt.set(manipCamera.lookAt); |
---|
13224 | 14477 | repaint(); |
---|
.. | .. |
---|
13230 | 14483 | repaint(); |
---|
13231 | 14484 | break; |
---|
13232 | 14485 | case 'Z': |
---|
13233 | | - RESIZETEXTURE ^= true; |
---|
13234 | | - break; |
---|
| 14486 | + //RESIZETEXTURE ^= true; |
---|
| 14487 | + //break; |
---|
13235 | 14488 | case 'z': |
---|
13236 | 14489 | RENDERSHADOW ^= true; |
---|
13237 | | - lighttouched = true; |
---|
| 14490 | + Globals.lighttouched = true; |
---|
13238 | 14491 | repaint(); |
---|
13239 | 14492 | break; |
---|
13240 | 14493 | //case UP: |
---|
.. | .. |
---|
13836 | 15089 | //if (g != gr) g.drawImage(img, 0, 0, width, height, null); |
---|
13837 | 15090 | } |
---|
13838 | 15091 | |
---|
| 15092 | + // To avoid clear. |
---|
13839 | 15093 | public void update(Graphics g) |
---|
13840 | 15094 | { |
---|
13841 | 15095 | paint(g); |
---|
.. | .. |
---|
14438 | 15692 | gl.glPushAttrib(GL.GL_ALL_ATTRIB_BITS); |
---|
14439 | 15693 | gl.glPushMatrix(); |
---|
14440 | 15694 | gl.glLoadIdentity(); |
---|
14441 | | - PushMatrix(checker.toParent); |
---|
| 15695 | + //PushMatrix(checker.toParent); |
---|
14442 | 15696 | |
---|
14443 | 15697 | gl.glMatrixMode(GL.GL_TEXTURE); |
---|
14444 | 15698 | gl.glPushMatrix(); |
---|
.. | .. |
---|
14461 | 15715 | |
---|
14462 | 15716 | gl.glNormal3f(0.0f, 0.0f, 1.0f); |
---|
14463 | 15717 | |
---|
14464 | | - float step = 0.1666f; //0.25f; |
---|
14465 | | - float stepv = step * 1652 / 998; |
---|
| 15718 | + float step = 2; // 0.1666f; //0.25f; |
---|
| 15719 | + float stepv = 2; // step * 1652 / 998; |
---|
14466 | 15720 | |
---|
14467 | 15721 | int i0 = 0; |
---|
14468 | 15722 | /* |
---|
.. | .. |
---|
14498 | 15752 | /**/ |
---|
14499 | 15753 | //checker.GetMaterial().opacity = 1.1f; |
---|
14500 | 15754 | ////checker.GetMaterial().ambient = 0.99f; |
---|
14501 | | - Object3D.materialstack[Object3D.materialdepth] = checker.material; |
---|
14502 | | - Object3D.selectedstack[Object3D.materialdepth] = false; |
---|
14503 | | - cStatic.objectstack[Object3D.materialdepth++] = checker; |
---|
| 15755 | + materialstack[materialdepth] = checker.material; |
---|
| 15756 | + selectedstack[materialdepth] = false; |
---|
| 15757 | + cStatic.objectstack[materialdepth++] = checker; |
---|
14504 | 15758 | //System.out.println("material " + material); |
---|
14505 | 15759 | //Applet3D.tracein(this, selected); |
---|
14506 | 15760 | vector2buffer = checker.projectedVertices; |
---|
14507 | 15761 | |
---|
14508 | | - checker.GetMaterial().Draw(this, false); // true); |
---|
| 15762 | + //checker.GetMaterial().Draw(this, false); // true); |
---|
| 15763 | + DrawMaterial(checker.GetMaterial(), false); // true); |
---|
14509 | 15764 | |
---|
14510 | | - Object3D.materialdepth -= 1; |
---|
14511 | | - if (Object3D.materialdepth > 0) |
---|
| 15765 | + materialdepth -= 1; |
---|
| 15766 | + if (materialdepth > 0) |
---|
14512 | 15767 | { |
---|
14513 | | - vector2buffer = cStatic.objectstack[Object3D.materialdepth - 1].projectedVertices; |
---|
14514 | | - Object3D.materialstack[Object3D.materialdepth - 1].Draw(this, Object3D.selectedstack[Object3D.materialdepth - 1]); |
---|
| 15768 | + vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
| 15769 | + DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1]); |
---|
14515 | 15770 | } |
---|
14516 | 15771 | //checker.GetMaterial().opacity = 1f; |
---|
14517 | 15772 | ////checker.GetMaterial().ambient = 1f; |
---|
.. | .. |
---|
14532 | 15787 | |
---|
14533 | 15788 | //float u = (i+1)/2; |
---|
14534 | 15789 | //float v = (j+1)/2; |
---|
14535 | | - gl.glTexCoord2f((i + 1) / 2, (j + 1) / 2); // (1,0) // (i+1+step)/2,(j+1)/2); |
---|
| 15790 | + if (checker.flipV) |
---|
| 15791 | + gl.glTexCoord2f((i + 1) / 2, 1 - (j + 1) / 2); |
---|
| 15792 | + else |
---|
| 15793 | + gl.glTexCoord2f((i + 1) / 2, (j + 1) / 2); // (1,0) // (i+1+step)/2,(j+1)/2); |
---|
14536 | 15794 | gl.glVertex3f(i, j, -0.5f); |
---|
14537 | 15795 | |
---|
| 15796 | + if (checker.flipV) |
---|
| 15797 | + gl.glTexCoord2f((i + 1 + step) / 2, 1 - (j + 1) / 2); // (1,1) // (i+1+step)/2,(j+1+step)/2); |
---|
| 15798 | + else |
---|
14538 | 15799 | gl.glTexCoord2f((i + 1 + step) / 2, (j + 1) / 2); // (1,1) // (i+1+step)/2,(j+1+step)/2); |
---|
14539 | 15800 | gl.glVertex3f(i + step, j, -0.5f); |
---|
14540 | 15801 | |
---|
| 15802 | + if (checker.flipV) |
---|
| 15803 | + gl.glTexCoord2f((i + 1 + step) / 2, 1 - (j + 1 + stepv) / 2); // (0,1) //(i+1)/2,(j+1+step)/2); |
---|
| 15804 | + else |
---|
14541 | 15805 | gl.glTexCoord2f((i + 1 + step) / 2, (j + 1 + stepv) / 2); // (0,1) //(i+1)/2,(j+1+step)/2); |
---|
14542 | 15806 | gl.glVertex3f(i + step, j + stepv, -0.5f); |
---|
14543 | 15807 | |
---|
| 15808 | + if (checker.flipV) |
---|
| 15809 | + gl.glTexCoord2f((i + 1) / 2, 1 - (j + 1 + stepv) / 2); // (0,0) //(i+1)/2,(j+1)/2); |
---|
| 15810 | + else |
---|
14544 | 15811 | gl.glTexCoord2f((i + 1) / 2, (j + 1 + stepv) / 2); // (0,0) //(i+1)/2,(j+1)/2); |
---|
14545 | 15812 | gl.glVertex3f(i, j + stepv, -0.5f); |
---|
14546 | 15813 | } |
---|
.. | .. |
---|
14552 | 15819 | gl.glMatrixMode(GL.GL_PROJECTION); |
---|
14553 | 15820 | gl.glPopMatrix(); |
---|
14554 | 15821 | gl.glMatrixMode(GL.GL_MODELVIEW); |
---|
14555 | | - PopMatrix(null); // checker.toParent); // null); |
---|
| 15822 | + //PopMatrix(null); // checker.toParent); // null); |
---|
14556 | 15823 | gl.glPopMatrix(); |
---|
14557 | 15824 | PopTextureMatrix(checker.toParent); |
---|
14558 | 15825 | gl.glMatrixMode(GL.GL_TEXTURE); |
---|
.. | .. |
---|
14665 | 15932 | |
---|
14666 | 15933 | //int tmp = selection_view; |
---|
14667 | 15934 | //selection_view = -1; |
---|
14668 | | - int temp = drawMode; |
---|
14669 | | - drawMode = SELECTION; |
---|
| 15935 | + int temp = DrawMode(); |
---|
| 15936 | + Globals.drawMode = SELECTION; // WARNING |
---|
14670 | 15937 | indexcount = 0; |
---|
14671 | 15938 | parent.display(drawable); |
---|
14672 | 15939 | //selection_view = tmp; |
---|
14673 | 15940 | //if (temp == SELECTION) |
---|
14674 | 15941 | // temp = DEFAULT; // patch for selection debug |
---|
14675 | | - drawMode = temp; |
---|
| 15942 | + Globals.drawMode = temp; // WARNING |
---|
14676 | 15943 | |
---|
14677 | 15944 | //gl.glBindTexture(GL.GL_TEXTURE_2D, selection_view); |
---|
14678 | 15945 | |
---|
.. | .. |
---|
14945 | 16212 | //gl.glColorMask(false, false, false, false); |
---|
14946 | 16213 | |
---|
14947 | 16214 | //render_scene_from_light_view(gl, drawable, 0, 0); |
---|
14948 | | - if (RENDERSHADOW && lighttouched && !movingcamera) // && !parent.IsFreezed()) |
---|
| 16215 | + if (RENDERSHADOW && Globals.lighttouched && !movingcamera) // && !parent.IsFreezed()) |
---|
14949 | 16216 | { |
---|
14950 | 16217 | gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); |
---|
14951 | 16218 | |
---|
14952 | | - int temp = drawMode; |
---|
14953 | | - drawMode = SHADOW; |
---|
| 16219 | + int temp = DrawMode(); |
---|
| 16220 | + Globals.drawMode = SHADOW; // WARNING |
---|
14954 | 16221 | parent.display(drawable); |
---|
14955 | | - drawMode = temp; |
---|
| 16222 | + Globals.drawMode = temp; // WARNING |
---|
14956 | 16223 | } |
---|
14957 | 16224 | |
---|
14958 | 16225 | gl.glCullFace(gl.GL_BACK); |
---|
.. | .. |
---|
15005 | 16272 | |
---|
15006 | 16273 | class AntialiasBuffer implements GLEventListener |
---|
15007 | 16274 | { |
---|
15008 | | - |
---|
15009 | 16275 | CameraPane parent = null; |
---|
15010 | 16276 | |
---|
15011 | 16277 | AntialiasBuffer(CameraPane p) |
---|
.. | .. |
---|
15115 | 16381 | gl.glFlush(); |
---|
15116 | 16382 | |
---|
15117 | 16383 | /**/ |
---|
15118 | | - gl.glReadPixels(0, 0, OCCLUSION_SIZE, OCCLUSION_SIZE, GL.GL_BGRA, GL.GL_UNSIGNED_INT_8_8_8_8_REV, occlusionsizebuffer); |
---|
| 16384 | + gl.glReadPixels(0, 0, OCCLUSION_SIZE, OCCLUSION_SIZE, GL.GL_DEPTH_COMPONENT, GL.GL_FLOAT, occlusionsizebuffer); |
---|
15119 | 16385 | |
---|
15120 | | - int[] pixels = occlusionsizebuffer.array(); |
---|
| 16386 | + float[] pixels = occlusionsizebuffer.array(); |
---|
15121 | 16387 | |
---|
15122 | 16388 | double r = 0, g = 0, b = 0; |
---|
15123 | 16389 | |
---|
15124 | 16390 | double count = 0; |
---|
| 16391 | + |
---|
| 16392 | + gl.glGetDoublev(gl.GL_PROJECTION_MATRIX, tempmat2, 0); |
---|
| 16393 | + |
---|
| 16394 | + float mindepth = 1; |
---|
| 16395 | + |
---|
| 16396 | + double FACTOR = 1; |
---|
15125 | 16397 | |
---|
15126 | 16398 | for (int i = 0; i < pixels.length; i++) |
---|
15127 | 16399 | { |
---|
.. | .. |
---|
15206 | 16478 | |
---|
15207 | 16479 | double scale = ray.z; // 1; // cos |
---|
15208 | 16480 | |
---|
15209 | | - int p = pixels[newindex]; |
---|
| 16481 | + float depth = pixels[newindex]; |
---|
15210 | 16482 | |
---|
15211 | 16483 | /* |
---|
15212 | 16484 | int newindex2 = (x + 1) * OCCLUSION_SIZE + y; |
---|
.. | .. |
---|
15230 | 16502 | scale = (1 - modu) * modv; |
---|
15231 | 16503 | */ |
---|
15232 | 16504 | |
---|
15233 | | - r += ((p >> 16) & 0xFF) * scale / 255; |
---|
15234 | | - g += ((p >> 8) & 0xFF) * scale / 255; |
---|
15235 | | - b += (p & 0xFF) * scale / 255; |
---|
| 16505 | + //r += ((p >> 16) & 0xFF) * scale / 255; |
---|
| 16506 | + //g += ((p >> 8) & 0xFF) * scale / 255; |
---|
| 16507 | + //b += (p & 0xFF) * scale / 255; |
---|
| 16508 | + |
---|
| 16509 | + if (mindepth > depth) |
---|
| 16510 | + { |
---|
| 16511 | + mindepth = depth; |
---|
| 16512 | + } |
---|
15236 | 16513 | |
---|
| 16514 | + double z_eye = tempmat2[3*4 + 2] / (depth * -2.0 + 1.0 - tempmat2[2*4 + 2]); |
---|
| 16515 | + |
---|
| 16516 | + double factor = 1 - Math.exp(-z_eye * z_eye / FACTOR); |
---|
| 16517 | + |
---|
| 16518 | + r += factor * scale; |
---|
| 16519 | + g += factor * scale; |
---|
| 16520 | + b += factor * scale; |
---|
| 16521 | + |
---|
15237 | 16522 | count += scale; |
---|
15238 | 16523 | } |
---|
15239 | 16524 | |
---|
.. | .. |
---|
15331 | 16616 | GLUT glut = new GLUT(); |
---|
15332 | 16617 | |
---|
15333 | 16618 | |
---|
15334 | | - static final public int DEFAULT = 0; |
---|
15335 | | - static final public int SELECTION = 1; |
---|
15336 | | - static final public int SHADOW = 2; |
---|
15337 | | - static final public int OCCLUSION = 3; |
---|
15338 | | - static |
---|
15339 | | - public int drawMode = DEFAULT; |
---|
15340 | 16619 | public boolean spherical = false; |
---|
15341 | 16620 | static boolean DEBUG_OCCLUSION = false; |
---|
15342 | 16621 | static boolean DEBUG_SELECTION = false; |
---|
.. | .. |
---|
15351 | 16630 | //double[] selectedpoint = new double[3]; |
---|
15352 | 16631 | static Superellipsoid selectedpoint = new Superellipsoid(); |
---|
15353 | 16632 | static Sphere previousselectedpoint = null; |
---|
15354 | | - static Sphere debugpoint = new Sphere(); |
---|
15355 | | - static Sphere debugpoint2 = new Sphere(); |
---|
15356 | | - static Sphere debugpoint3 = new Sphere(); |
---|
15357 | | - static Sphere debugpoint4 = new Sphere(); |
---|
| 16633 | + static Sphere debugpointG = new Sphere(); |
---|
| 16634 | + static Sphere debugpointP = new Sphere(); |
---|
| 16635 | + static Sphere debugpointC = new Sphere(); |
---|
| 16636 | + static Sphere debugpointR = new Sphere(); |
---|
15358 | 16637 | |
---|
15359 | 16638 | static Sphere debugpoints[] = new Sphere[8]; |
---|
15360 | 16639 | |
---|
.. | .. |
---|
15385 | 16664 | } |
---|
15386 | 16665 | } |
---|
15387 | 16666 | |
---|
15388 | | - static void DrawPoints(CameraPane cpane) |
---|
| 16667 | + static void DrawPoints(iCameraPane cpane) |
---|
15389 | 16668 | { |
---|
15390 | 16669 | for (int i=0; i<8; i++) // first and last are red |
---|
15391 | 16670 | { |
---|
.. | .. |
---|
15407 | 16686 | static IntBuffer texturesizebuffer = IntBuffer.allocate(TEX_SIZE * TEX_SIZE); |
---|
15408 | 16687 | static IntBuffer selectsizebuffer = IntBuffer.allocate(SELECT_SIZE * SELECT_SIZE); |
---|
15409 | 16688 | static java.nio.FloatBuffer pointselectsizebuffer = java.nio.FloatBuffer.allocate(SELECT_SIZE * SELECT_SIZE); |
---|
15410 | | - static IntBuffer occlusionsizebuffer = IntBuffer.allocate(OCCLUSION_SIZE * OCCLUSION_SIZE); |
---|
| 16689 | + //static IntBuffer occlusionsizebuffer = IntBuffer.allocate(OCCLUSION_SIZE * OCCLUSION_SIZE); |
---|
| 16690 | + static java.nio.FloatBuffer occlusionsizebuffer = java.nio.FloatBuffer.allocate(OCCLUSION_SIZE * OCCLUSION_SIZE); |
---|
15411 | 16691 | static BufferedImage bufimage = new BufferedImage(TEX_SIZE, TEX_SIZE, BufferedImage.TYPE_INT_RGB); |
---|
15412 | 16692 | static BufferedImage textest = new cBufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); |
---|
15413 | 16693 | static java.util.Vector<BufferedImage> billboards = new java.util.Vector<BufferedImage>(); |
---|