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
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);
}
// This is one of the crates that are being drawn.
// float startX, float startY, float startZ, float endX, float endY, float endZ, Texture texSurround
collidable.add(new PolyVoxel(20, 0.1f, 2, 22, 2, 4, texCrate));
// Rotation values are created from mouse movement (FPS camera).
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.