Hi, so I obtained source code from
http://www.youtube.com/watch?v=O0xtgfcxcq0&feature=plcp but noticed a strange visual effect.
I plugged in the code and when looking directly down onto a block this occurred.



I have jumped around with learning OpenGL but I've firmly started recently but I havn't been able to resolve the issue, yet.
Here is parts of the code that hopefully explains the problem
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| static int width=800, height=600;
DisplayMode dm = new DisplayMode(width,height); for(DisplayMode mode : Display.getAvailableDisplayModes()){ if(mode.getWidth() == 800 && mode.getHeight() == 600 && mode.isFullscreenCapable() && mode.getBitsPerPixel() == 32){ dm = mode; break; } } if(dm.isFullscreenCapable()) Display.setFullscreen(false); Display.setDisplayMode(dm); Display.create();
private void initGL3() { GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity();
GLU.gluPerspective((float) 100, App.width / App.height, 0.001f, 1000); GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glShadeModel(GL11.GL_SMOOTH); GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.5f); GL11.glClearDepth(1.0f); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glDepthFunc(GL11.GL_LEQUAL); }
collidable.add(new PolyVoxel(20, 0.1f, 2, 22, 2, 4, texCrate));
public void translateCamera() { GL11.glRotatef(rotation.x, 1, 0, 0); GL11.glRotatef(rotation.y, 0, 1, 0); GL11.glRotatef(rotation.z, 0, 0, 1); GL11.glTranslatef(-vector.x, -vector.y - 1.4f, -vector.z); } |
Sorry for the long post, if someone could point me in the right direction I would be grateful,
thanks for your time.