.. | .. |
---|
187 | 187 | } |
---|
188 | 188 | |
---|
189 | 189 | private File defaultDirectory = javax.swing.filechooser.FileSystemView.getFileSystemView().getDefaultDirectory(); |
---|
| 190 | + |
---|
| 191 | + public void LoadSkybox(String name, String ext, boolean mipmap) throws GLException |
---|
| 192 | + { |
---|
| 193 | + try |
---|
| 194 | + { |
---|
| 195 | + cubemap = LoadCubemap(getClass().getClassLoader(), name, ext, mipmap); |
---|
| 196 | + } catch (IOException e) |
---|
| 197 | + { |
---|
| 198 | + System.out.println("NAME = " + name); |
---|
| 199 | + e.printStackTrace(); // throw new RuntimeException(e); |
---|
| 200 | + } |
---|
| 201 | + } |
---|
190 | 202 | |
---|
191 | 203 | void SetAsGLRenderer(boolean b) |
---|
192 | 204 | { |
---|
.. | .. |
---|
1485 | 1497 | gl.glVertex3f((float) pv.x, (float) pv.y, (float) pv.z); |
---|
1486 | 1498 | } |
---|
1487 | 1499 | |
---|
| 1500 | + float[] colorV = new float[4]; |
---|
| 1501 | + |
---|
1488 | 1502 | void SetColor(Object3D obj, Vertex p0) |
---|
1489 | 1503 | { |
---|
1490 | 1504 | CameraPane display = this; |
---|
.. | .. |
---|
1552 | 1566 | { |
---|
1553 | 1567 | return; |
---|
1554 | 1568 | } |
---|
1555 | | - |
---|
1556 | | - float[] colorV = new float[3]; |
---|
1557 | 1569 | |
---|
1558 | 1570 | if (false) // marked) |
---|
1559 | 1571 | { |
---|
.. | .. |
---|
8346 | 8358 | // else |
---|
8347 | 8359 | // if (!texname.startsWith("/")) |
---|
8348 | 8360 | // texname = "/Users/nbriere/Textures/" + texname; |
---|
8349 | | - if (!FileExists(texname)) |
---|
| 8361 | + if (!FileExists(texname) && !texname.startsWith("@")) |
---|
8350 | 8362 | { |
---|
8351 | 8363 | texname = fallbackTextureName; |
---|
8352 | 8364 | } |
---|
.. | .. |
---|
8429 | 8441 | new Exception().printStackTrace(); |
---|
8430 | 8442 | } else |
---|
8431 | 8443 | { |
---|
| 8444 | + if (texname.startsWith("@")) |
---|
| 8445 | + { |
---|
| 8446 | + // texturecache = textures.get(texname); // suspicious |
---|
| 8447 | + if (texturecache == null) |
---|
| 8448 | + texturecache = new CacheTexture(GetResourceTexture(texname.substring(1), bump),resolution); |
---|
| 8449 | + else |
---|
| 8450 | + new Exception().printStackTrace(); |
---|
| 8451 | + } else |
---|
| 8452 | + { |
---|
8432 | 8453 | if (textureon) |
---|
8433 | 8454 | { |
---|
8434 | 8455 | String cachename = texname; |
---|
.. | .. |
---|
8488 | 8509 | texturecache = new CacheTexture(texturedata,resolution); |
---|
8489 | 8510 | //texture = GetTexture(tex, bump); |
---|
8490 | 8511 | } |
---|
| 8512 | + } |
---|
8491 | 8513 | } |
---|
8492 | 8514 | //} |
---|
8493 | 8515 | } |
---|
.. | .. |
---|
8932 | 8954 | |
---|
8933 | 8955 | if (cubemap == null) |
---|
8934 | 8956 | { |
---|
8935 | | - LoadEnvy(5); |
---|
| 8957 | + //LoadEnvy(1); |
---|
8936 | 8958 | } |
---|
8937 | 8959 | |
---|
8938 | 8960 | //cubemap.enable(); |
---|
.. | .. |
---|
9219 | 9241 | cubemap = null; |
---|
9220 | 9242 | return; |
---|
9221 | 9243 | case 1: |
---|
9222 | | - name = "cubemaps/box_"; |
---|
9223 | | - ext = "png"; |
---|
| 9244 | + name = "cubemaps/rgb/"; |
---|
| 9245 | + ext = "jpg"; |
---|
9224 | 9246 | reverseUP = false; |
---|
9225 | 9247 | break; |
---|
9226 | 9248 | case 2: |
---|
9227 | | - name = "cubemaps/uffizi_"; |
---|
9228 | | - ext = "png"; |
---|
9229 | | - break; // reverseUP = true; break; |
---|
| 9249 | + name = "cubemaps/uffizi/"; |
---|
| 9250 | + ext = "jpg"; |
---|
| 9251 | + reverseUP = false; |
---|
| 9252 | + break; |
---|
9230 | 9253 | case 3: |
---|
9231 | | - name = "cubemaps/CloudyHills_"; |
---|
9232 | | - ext = "tga"; |
---|
| 9254 | + name = "cubemaps/CloudyHills/"; |
---|
| 9255 | + ext = "jpg"; |
---|
9233 | 9256 | reverseUP = false; |
---|
9234 | 9257 | break; |
---|
9235 | 9258 | case 4: |
---|
9236 | | - name = "cubemaps/cornell_"; |
---|
| 9259 | + name = "cubemaps/cornell/"; |
---|
9237 | 9260 | ext = "png"; |
---|
9238 | 9261 | reverseUP = false; |
---|
9239 | 9262 | break; |
---|
| 9263 | + case 5: |
---|
| 9264 | + name = "cubemaps/skycube/"; |
---|
| 9265 | + ext = "jpg"; |
---|
| 9266 | + reverseUP = false; |
---|
| 9267 | + break; |
---|
| 9268 | + case 6: |
---|
| 9269 | + name = "cubemaps/SaintLazarusChurch3/"; |
---|
| 9270 | + ext = "jpg"; |
---|
| 9271 | + reverseUP = false; |
---|
| 9272 | + break; |
---|
| 9273 | + case 7: |
---|
| 9274 | + name = "cubemaps/Sodermalmsallen/"; |
---|
| 9275 | + ext = "jpg"; |
---|
| 9276 | + reverseUP = false; |
---|
| 9277 | + break; |
---|
| 9278 | + case 8: |
---|
| 9279 | + name = "cubemaps/Sodermalmsallen2/"; |
---|
| 9280 | + ext = "jpg"; |
---|
| 9281 | + reverseUP = false; |
---|
| 9282 | + break; |
---|
| 9283 | + case 9: |
---|
| 9284 | + name = "cubemaps/UnionSquare/"; |
---|
| 9285 | + ext = "jpg"; |
---|
| 9286 | + reverseUP = false; |
---|
| 9287 | + break; |
---|
9240 | 9288 | default: |
---|
9241 | | - name = "cubemaps/rgb_"; |
---|
9242 | | - ext = "png"; /*mipmap = true;*/ reverseUP = false; |
---|
| 9289 | + name = "cubemaps/box/"; |
---|
| 9290 | + ext = "png"; /*mipmap = true;*/ |
---|
| 9291 | + reverseUP = false; |
---|
9243 | 9292 | break; |
---|
9244 | 9293 | } |
---|
9245 | | - |
---|
9246 | | - try |
---|
9247 | | - { |
---|
9248 | | - cubemap = LoadCubemap(getClass().getClassLoader(), name, ext, mipmap); |
---|
9249 | | - } catch (IOException e) |
---|
9250 | | - { |
---|
9251 | | - throw new RuntimeException(e); |
---|
9252 | | - } |
---|
| 9294 | + |
---|
| 9295 | + LoadSkybox(name, ext, mipmap); |
---|
9253 | 9296 | } |
---|
9254 | 9297 | |
---|
9255 | 9298 | public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) |
---|
.. | .. |
---|
9281 | 9324 | static double[] model = new double[16]; |
---|
9282 | 9325 | double[] camera2light = new double[16]; |
---|
9283 | 9326 | double[] light2camera = new double[16]; |
---|
9284 | | - int newenvy = -1; |
---|
9285 | | - boolean envyoff = true; // false; |
---|
| 9327 | + |
---|
| 9328 | + //int newenvy = -1; |
---|
| 9329 | + //boolean envyoff = false; |
---|
| 9330 | + |
---|
| 9331 | + String loadedskyboxname; |
---|
| 9332 | + |
---|
9286 | 9333 | cVector light0 = new cVector(0, 0, 0); // 1,3,2); |
---|
9287 | 9334 | //float[] light0 = { 0,0,0 }; |
---|
9288 | 9335 | cVector dirlight = new cVector(0, 0, 1); // 1,3,2); |
---|
.. | .. |
---|
9762 | 9809 | rati = 1 / rati; |
---|
9763 | 9810 | gl.glOrtho(-skyscale / rati, skyscale / rati, -skyscale, skyscale, 0.001, 1000); |
---|
9764 | 9811 | } |
---|
9765 | | - assert (newenvy == -1); |
---|
| 9812 | + |
---|
| 9813 | + //assert (newenvy == -1); |
---|
| 9814 | + |
---|
9766 | 9815 | gl.glDisable(GL.GL_FRAGMENT_PROGRAM_ARB); |
---|
9767 | 9816 | gl.glDisable(GL.GL_VERTEX_PROGRAM_ARB); |
---|
9768 | | - DrawSkyBox(gl); |
---|
| 9817 | + DrawSkyBox(gl, (float)rati); |
---|
9769 | 9818 | gl.glEnable(GL.GL_FRAGMENT_PROGRAM_ARB); |
---|
9770 | 9819 | gl.glEnable(GL.GL_VERTEX_PROGRAM_ARB); |
---|
9771 | 9820 | accPerspective(gl, renderCamera.shaper_fovy / ratio, |
---|
.. | .. |
---|
10802 | 10851 | |
---|
10803 | 10852 | if (wait) |
---|
10804 | 10853 | { |
---|
10805 | | - Sleep(500); |
---|
| 10854 | + Sleep(200); // blocks everything |
---|
10806 | 10855 | |
---|
10807 | 10856 | wait = false; |
---|
10808 | 10857 | } |
---|
.. | .. |
---|
11018 | 11067 | gl.glOrtho(-skyscale / ratio, skyscale / ratio, -skyscale, skyscale, 0.001, 1000); |
---|
11019 | 11068 | } |
---|
11020 | 11069 | |
---|
11021 | | - if (newenvy > -1) |
---|
| 11070 | +// if (newenvy > -1) |
---|
| 11071 | +// { |
---|
| 11072 | +// LoadEnvy(newenvy); |
---|
| 11073 | +// } |
---|
| 11074 | +// |
---|
| 11075 | +// newenvy = -1; |
---|
| 11076 | + |
---|
| 11077 | + if (object.skyboxname != null) |
---|
11022 | 11078 | { |
---|
11023 | | - LoadEnvy(newenvy); |
---|
| 11079 | + if (!object.skyboxname.equals(this.loadedskyboxname)) |
---|
| 11080 | + { |
---|
| 11081 | + LoadSkybox(object.skyboxname + "/", object.skyboxext, false); |
---|
| 11082 | + loadedskyboxname = object.skyboxname; |
---|
| 11083 | + } |
---|
11024 | 11084 | } |
---|
11025 | | - |
---|
11026 | | - newenvy = -1; |
---|
11027 | | - |
---|
| 11085 | + else |
---|
| 11086 | + { |
---|
| 11087 | + cubemap = null; |
---|
| 11088 | + loadedskyboxname = null; |
---|
| 11089 | + } |
---|
| 11090 | + |
---|
11028 | 11091 | ratio = ((double) getWidth()) / getHeight(); |
---|
11029 | 11092 | //System.out.println("ratio = " + ratio); |
---|
11030 | 11093 | |
---|
.. | .. |
---|
11040 | 11103 | |
---|
11041 | 11104 | if (!IsFrozen() && !ambientOcclusion) |
---|
11042 | 11105 | { |
---|
11043 | | - DrawSkyBox(gl); |
---|
| 11106 | + DrawSkyBox(gl, (float)ratio); |
---|
11044 | 11107 | } |
---|
11045 | 11108 | |
---|
11046 | 11109 | //if (selection_view == -1) |
---|
.. | .. |
---|
11326 | 11389 | |
---|
11327 | 11390 | // if (cam != lightCamera) |
---|
11328 | 11391 | //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
11329 | | - LA.xformDir(lightposition, parentcam.GlobalTransform(), lightposition); // may 2013 |
---|
| 11392 | + LA.xformDir(lightposition, parentcam.GlobalTransformInv(), lightposition); // may 2013 |
---|
11330 | 11393 | } |
---|
11331 | 11394 | |
---|
11332 | 11395 | LA.xformDir(lightposition, cam.toScreen, lightposition); |
---|
.. | .. |
---|
12400 | 12463 | |
---|
12401 | 12464 | //gl.glProgramEnvParameter4fvARB(GL.GL_FRAGMENT_PROGRAM_ARB, 127, lightParams, 0); |
---|
12402 | 12465 | |
---|
12403 | | - String program = |
---|
| 12466 | + String programmin = |
---|
12404 | 12467 | // Min shader |
---|
12405 | 12468 | "!!ARBfp1.0\n" + |
---|
12406 | 12469 | "PARAM zero123 = { 0.0, 1.0, 2, 1.25 };" + |
---|
.. | .. |
---|
12451 | 12514 | //"SUB ndotl.y, zero123.y, ndotl.y;" + |
---|
12452 | 12515 | //"MUL ndotl.y, ndotl.y, pow2.z;" + |
---|
12453 | 12516 | |
---|
12454 | | - "MAX ndotl.x, ndotl.x, ndotl.y;" + // Ambient |
---|
| 12517 | + //"MAX ndotl.x, ndotl.x, ndotl.y;" + // Ambient |
---|
| 12518 | + //"MAX ndotl.x, ndotl.x, pow2.y;" + // Ambient |
---|
12455 | 12519 | |
---|
12456 | 12520 | // Pigment |
---|
12457 | 12521 | "TEX temp, fragment.texcoord[0], texture[0], 2D;" + |
---|
.. | .. |
---|
12466 | 12530 | "MOV result.color, temp;" + |
---|
12467 | 12531 | "END"; |
---|
12468 | 12532 | |
---|
12469 | | - String program2 = |
---|
| 12533 | + String programmax = |
---|
12470 | 12534 | "!!ARBfp1.0\n" + |
---|
12471 | 12535 | |
---|
12472 | 12536 | //"OPTION ARB_fragment_program_shadow;" + |
---|
.. | .. |
---|
12991 | 13055 | // display shadow only (fakedepth == 0) |
---|
12992 | 13056 | "SUB temp.x, half.x, shadow.x;" + |
---|
12993 | 13057 | "MOV temp.y, -params5.z;" + // params6.x;" + |
---|
12994 | | - "SLT temp.z, temp.y, -one2048th.x;" + |
---|
| 13058 | + "SLT temp.z, temp.y, -c256i.x;" + |
---|
12995 | 13059 | "SUB temp.y, one.x, temp.z;" + |
---|
12996 | 13060 | "MUL temp.x, temp.x, temp.y;" + |
---|
12997 | 13061 | "KIL temp.x;" + |
---|
.. | .. |
---|
13322 | 13386 | //once = true; |
---|
13323 | 13387 | } |
---|
13324 | 13388 | |
---|
| 13389 | + String program = programmax; |
---|
| 13390 | + |
---|
| 13391 | + if (Globals.MINSHADER) |
---|
| 13392 | + { |
---|
| 13393 | + program = programmin; |
---|
| 13394 | + } |
---|
| 13395 | + |
---|
13325 | 13396 | System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length()); |
---|
13326 | 13397 | System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : "")); |
---|
13327 | 13398 | loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program); |
---|
.. | .. |
---|
14571 | 14642 | MODIFIERS |= COMMAND; |
---|
14572 | 14643 | /**/ |
---|
14573 | 14644 | if((mod&SHIFT) == SHIFT) |
---|
14574 | | - manipCamera.RotatePosition(0, -speed); |
---|
14575 | | - else |
---|
14576 | 14645 | manipCamera.BackForth(0, -speed*delta, 0); // getWidth()); |
---|
| 14646 | + else |
---|
| 14647 | + manipCamera.RotatePosition(0, -speed); |
---|
14577 | 14648 | /**/ |
---|
14578 | 14649 | if ((mod & SHIFT) == SHIFT) |
---|
14579 | 14650 | { |
---|
.. | .. |
---|
14592 | 14663 | MODIFIERS |= COMMAND; |
---|
14593 | 14664 | /**/ |
---|
14594 | 14665 | if((mod&SHIFT) == SHIFT) |
---|
14595 | | - manipCamera.RotatePosition(0, speed); |
---|
14596 | | - else |
---|
14597 | 14666 | manipCamera.BackForth(0, speed*delta, 0); // getWidth()); |
---|
| 14667 | + else |
---|
| 14668 | + manipCamera.RotatePosition(0, speed); |
---|
14598 | 14669 | /**/ |
---|
14599 | 14670 | if ((mod & SHIFT) == SHIFT) |
---|
14600 | 14671 | { |
---|
.. | .. |
---|
15315 | 15386 | OCCLUSION_CULLING ^= true; |
---|
15316 | 15387 | System.out.println("OCCLUSION CULLING = " + OCCLUSION_CULLING); |
---|
15317 | 15388 | break; |
---|
15318 | | - case '0': envyoff ^= true; repaint(); break; |
---|
| 15389 | + //case '0': envyoff ^= true; repaint(); break; |
---|
15319 | 15390 | case '1': |
---|
15320 | 15391 | case '2': |
---|
15321 | 15392 | case '3': |
---|
15322 | 15393 | case '4': |
---|
15323 | 15394 | case '5': |
---|
15324 | | - newenvy = Character.getNumericValue(key); |
---|
15325 | | - repaint(); |
---|
15326 | | - break; |
---|
15327 | 15395 | case '6': |
---|
15328 | 15396 | case '7': |
---|
15329 | 15397 | case '8': |
---|
15330 | 15398 | case '9': |
---|
15331 | | - BGcolor = (key - '6')/3.f; |
---|
| 15399 | + if (true) // envyoff) |
---|
| 15400 | + { |
---|
| 15401 | + BGcolor = (key - '1')/8.f; |
---|
| 15402 | + } |
---|
| 15403 | + else |
---|
| 15404 | + { |
---|
| 15405 | + //newenvy = Character.getNumericValue(key); |
---|
| 15406 | + } |
---|
15332 | 15407 | repaint(); |
---|
15333 | 15408 | break; |
---|
15334 | 15409 | case '!': |
---|
.. | .. |
---|
16033 | 16108 | gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
16034 | 16109 | break; |
---|
16035 | 16110 | case Object3D.hitScale: gr.setColor(Color.cyan); |
---|
16036 | | - gr.drawLine(X, Y, 0, 0); |
---|
| 16111 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
16037 | 16112 | break; |
---|
16038 | 16113 | } |
---|
16039 | 16114 | |
---|
.. | .. |
---|
16519 | 16594 | private /*static*/ boolean firstime; |
---|
16520 | 16595 | private /*static*/ cVector newView = new cVector(); |
---|
16521 | 16596 | private static final String[] suffixes = {"posx", "negx", "posy", "negy", "posz", "negz"}; |
---|
| 16597 | + private static final String[] suffixes2 = {"east", "west", "top", "bottom", "north", "south"}; |
---|
| 16598 | + private static final String[] suffixes3 = {"ft", "bk", "up", "dn", "rt", "lf"}; |
---|
16522 | 16599 | private static final int[] targets = {GL.GL_TEXTURE_CUBE_MAP_POSITIVE_X, |
---|
16523 | 16600 | GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_X, |
---|
16524 | 16601 | GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Y, |
---|
.. | .. |
---|
16531 | 16608 | { |
---|
16532 | 16609 | com.sun.opengl.util.texture.Texture cubemap = TextureIO.newTexture(GL.GL_TEXTURE_CUBE_MAP); |
---|
16533 | 16610 | |
---|
| 16611 | + int usedsuf = 0; |
---|
| 16612 | + |
---|
16534 | 16613 | for (int i = 0; i < suffixes.length; i++) |
---|
16535 | 16614 | { |
---|
16536 | | - String resourceName = basename + suffixes[i] + "." + suffix; |
---|
16537 | | - TextureData data = TextureIO.newTextureData(scope.getResourceAsStream(resourceName), |
---|
16538 | | - mipmapped, |
---|
16539 | | - FileUtil.getFileSuffix(resourceName)); |
---|
16540 | | - if (data == null) |
---|
| 16615 | + String[] suffixe = suffixes; |
---|
| 16616 | + String[] fallback = suffixes2; |
---|
| 16617 | + String[] fallfallback = suffixes3; |
---|
| 16618 | + |
---|
| 16619 | + for (int c=usedsuf; --c>=0;) |
---|
16541 | 16620 | { |
---|
16542 | | - throw new IOException("Unable to load texture " + resourceName); |
---|
| 16621 | +// String[] temp = suffixe; |
---|
| 16622 | +// suffixe = fallback; |
---|
| 16623 | +// fallback = fallfallback; |
---|
| 16624 | +// fallfallback = temp; |
---|
16543 | 16625 | } |
---|
| 16626 | + |
---|
| 16627 | + String resourceName = basename + suffixe[i] + "." + suffix; |
---|
| 16628 | + TextureData data; |
---|
| 16629 | + |
---|
| 16630 | + try |
---|
| 16631 | + { |
---|
| 16632 | + data = TextureIO.newTextureData(scope.getResourceAsStream(resourceName), |
---|
| 16633 | + mipmapped, |
---|
| 16634 | + FileUtil.getFileSuffix(resourceName)); |
---|
| 16635 | + } |
---|
| 16636 | + catch (Exception e) |
---|
| 16637 | + { |
---|
| 16638 | + try |
---|
| 16639 | + { |
---|
| 16640 | + resourceName = basename + fallback[i] + "." + suffix; |
---|
| 16641 | + data = TextureIO.newTextureData(scope.getResourceAsStream(resourceName), |
---|
| 16642 | + mipmapped, |
---|
| 16643 | + FileUtil.getFileSuffix(resourceName)); |
---|
| 16644 | + } |
---|
| 16645 | + catch (Exception e2) |
---|
| 16646 | + { |
---|
| 16647 | + resourceName = basename + fallfallback[i] + "." + suffix; |
---|
| 16648 | + data = TextureIO.newTextureData(scope.getResourceAsStream(resourceName), |
---|
| 16649 | + mipmapped, |
---|
| 16650 | + FileUtil.getFileSuffix(resourceName)); |
---|
| 16651 | + } |
---|
| 16652 | + } |
---|
| 16653 | + |
---|
16544 | 16654 | //System.out.println("Target = " + targets[i]); |
---|
16545 | 16655 | cubemap.updateImage(data, targets[i]); |
---|
16546 | 16656 | } |
---|
16547 | 16657 | |
---|
16548 | 16658 | return cubemap; |
---|
16549 | 16659 | } |
---|
| 16660 | + |
---|
16550 | 16661 | int bigsphere = -1; |
---|
16551 | 16662 | |
---|
16552 | 16663 | float BGcolor = 0.5f; |
---|
16553 | 16664 | |
---|
16554 | | - private void DrawSkyBox(GL gl) |
---|
| 16665 | + float ambientLight[] = {1f, 1f, 1f, 1.0f}; |
---|
| 16666 | + |
---|
| 16667 | + private void DrawSkyBox(GL gl, float ratio) |
---|
16555 | 16668 | { |
---|
16556 | | - if (envyoff || cubemap == null) |
---|
| 16669 | + if (//envyoff || |
---|
| 16670 | + WIREFRAME || |
---|
| 16671 | + cubemap == null) |
---|
16557 | 16672 | { |
---|
16558 | 16673 | gl.glClearColor(BGcolor, BGcolor, BGcolor, 1); |
---|
16559 | 16674 | gl.glClear(gl.GL_COLOR_BUFFER_BIT); |
---|
.. | .. |
---|
16568 | 16683 | // Compensates for ExaminerViewer's modification of modelview matrix |
---|
16569 | 16684 | gl.glMatrixMode(GL.GL_MODELVIEW); |
---|
16570 | 16685 | gl.glLoadIdentity(); |
---|
| 16686 | + gl.glScalef(1,ratio,1); |
---|
16571 | 16687 | |
---|
| 16688 | +// colorV[0] = 2; |
---|
| 16689 | +// colorV[1] = 2; |
---|
| 16690 | +// colorV[2] = 2; |
---|
| 16691 | +// colorV[3] = 1; |
---|
| 16692 | +// gl.glDisable(gl.GL_COLOR_MATERIAL); |
---|
| 16693 | +// gl.glMaterialfv(gl.GL_FRONT_AND_BACK, gl.GL_AMBIENT, colorV, 0); |
---|
| 16694 | +// |
---|
| 16695 | +// gl.glLightModelfv(gl.GL_LIGHT_MODEL_AMBIENT, ambientLight, 0); |
---|
| 16696 | + |
---|
16572 | 16697 | //gl.glActiveTexture(GL.GL_TEXTURE1); |
---|
16573 | 16698 | //gl.glDisable(GL.GL_TEXTURE_CUBE_MAP); |
---|
16574 | 16699 | |
---|
.. | .. |
---|
16600 | 16725 | { |
---|
16601 | 16726 | gl.glScalef(1.0f, -1.0f, 1.0f); |
---|
16602 | 16727 | } |
---|
| 16728 | + gl.glScalef(-1.0f, 1.0f, 1.0f); |
---|
16603 | 16729 | gl.glMultMatrixd(viewrot_1, 0); |
---|
16604 | 16730 | gl.glTranslatef(0, 0, 0.5f); // (float)lightCamera.Distance()); // 0.5f); |
---|
16605 | 16731 | //viewer.updateInverseRotation(gl); |
---|
.. | .. |
---|
16858 | 16984 | //new Exception().printStackTrace(); |
---|
16859 | 16985 | System.out.println("select buffer init"); |
---|
16860 | 16986 | // Use debug pipeline |
---|
16861 | | - drawable.setGL(new DebugGL(drawable.getGL())); |
---|
| 16987 | + //drawable.setGL(new DebugGL(drawable.getGL())); |
---|
16862 | 16988 | |
---|
16863 | 16989 | GL gl = drawable.getGL(); |
---|
16864 | 16990 | |
---|