PDA

View Full Version : Skybox visual glitch



wikaman1
03-20-2012, 02:51 PM
Hi, I'm trying to create a skybox with a cube and depth testing. I'm getting a visual glitch that you can see in this picture http://s7.postimage.org/t4ct0rfwr/glitch.jpg

as you can see not all the skybox is drawn, just the part you're looking at directly, a section is cut off (this undrawn section moves when you turn)

this is my code:

glPushMatrix();
glDisable(GL_DEPTH_TEST);
glTranslatef(cam.fOrigin.x, cam.fOrigin.y, cam.fOrigin.z);
Draw_CUBE();
glPopMatrix();
glEnable(GL_DEPTH_TEST);


any ideas?

Kopelrativ
03-22-2012, 08:54 AM
I had a similar problem, maybe this can help you: http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Main=59585&Number=3092 96

BionicBytes
03-22-2012, 09:57 AM
looks like it's being clipped by the near plane.
What's in DRAW_CUBE and what depth state have you set inc. Perspective matrix?

wikaman1
03-22-2012, 01:03 PM
looks like it's being clipped by the near plane.
What's in DRAW_CUBE and what depth state have you set inc. Perspective matrix?

yeah I figured it out, the cube that I had drawn around the camera was too small and that was causing it to get clipped, I scaled it by 1.2 and it fixed the problem, thanks for the replys