Advertisement

Problem with walls disappearing

Started by November 04, 2000 01:53 PM
1 comment, last by rileyriley 24 years ago
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
--Riley
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
------------------General Equation, this is Private Function reporting for duty, sir!a2k
Advertisement
THanks a lot, works perfectly. Very interesting if you set the near clip to 0 =)
--Riley

This topic is closed to new replies.

Advertisement