PDA

View Full Version : Disrupted Object



TorbenKeil
02-12-2001, 03:37 PM
Hi,

I need some help with my textured object.
I programmed a cube with 4 different textures and one 'animated' texture.
It looks good, but while the cube is moving in my 3D-world sometimes it isnt shown as a cube. Sometimes it is disrupted - it looks like that the computer forgets to print some trinangles at the border to of the textures. Behind those missed triangles the texture of the next wall is shown.
I have no idea why this happens.
Can someone help me?

Thanks,

Torben

DFrey
02-13-2001, 07:30 AM
This sounds like z fighting. In this case, you can solve this if your textures are opaque simply by enabling back face culling. The better way is to adjust your near and far clipping planes to make better use of the z precision. That is, make your near clipping plane closer to the far clipping plane.

TorbenKeil
02-13-2001, 10:19 AM
Thanks,
how do you mean that with adjusting near and far clipping planes?
I have a max of sight of 150.0 and between this is the whole world.
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,0.01f,MaxSight);

What can I change?

Thanks,
Torben

DFrey
02-13-2001, 10:43 AM
Try increasing that 0.01f (the near clipping plane) to 1.0f or higher (but still less than MaxSight).

TorbenKeil
02-13-2001, 12:11 PM
Thanks, that was it!! :-))