#### Archived

This topic is now archived and is closed to further replies.

# Problem with walls disappearing

## Recommended Posts

I''m a mundo newbie to open gl, just started learning this week, so please excuse any idiocies you find in the following post... I''m making a program that generates a maze and lets the user walk around it using the numberpad, similar to that screensaver on a lot of windows computers with the brick walls and the rat running around on the floor. I''ve got the maze generation part down, and it draws in 3d fine if the camera is pretty far away from it - that is, if the camera is not actually in the maze it looks perfect. BUT: When the camera is in the maze, walls mysteriously get cut off at a certain distance from the camera. When you walk forward, the walls get eaten away gradually. This is kind of a big problems because mazes tend to get significantly easier when you can see through walls ;-) The distance from the camera appears to be approximately 1 when they start disappearing, but I don''t know that it is exactly 1. Is this a common problem or am I doing something completely stupidly? My suspicion first fell on
glClearDepth(1.0f);
but I messed with it and it didn''t seem to change very much (for the better anyway, when I changed 1.0 to 0 hardly anything drew, but changing it to 10 didn''t have any noticable effects). Thanks for any help /riley

##### Share on other sites
if you use the gluperspective() command, the last 2 parameters are zclip near and far. set near to something like 0.5 or 1, and set far to as far away as you''d like (taking into account rendering issues).

so, if the maze was like a diameter of 50, the far value can safely be like 60 or so.

a2k

##### Share on other sites
THanks a lot, works perfectly. Very interesting if you set the near clip to 0 =)

• ### Forum Statistics

• Total Topics
628314
• Total Posts
2982022

• 9
• 9
• 13
• 11
• 14