Jump to content
  • Advertisement
Sign in to follow this  
xeexIII

avoid figure cut

This topic is 4051 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
You're getting too close to the object and it is being clipped by the near clipping plane. To avoid it, decrease the near clipping plane distance (specified where you set up your projection matrix). Be aware that this will effect your depth precision. You won't be able to completely get rid of it though; not until you implement collision detection and prohibit your camera from going through the object.

Share this post


Link to post
Share on other sites
thanks Kalidor for the answer



you mean decrease this:

glFrustum (-1.0, 1.0, -1.0, 1.0, 1, 500.0);

the fifth parameter???

Share this post


Link to post
Share on other sites
Yep, that's the near plane distance. Decreasing it will let you get closer to the object before it starts to clip against the near plane. Just remember that it drastically effects your usable depth precision. And also for perspective projection matrices, both the near and far plane distances need to be positive (as in greater than 0, not greater than or equal to).

For the most flexibility it's nice to have a dynamic near/far plane. What I mean by that is every frame (or every few frames) you update the near and far distances based on the distances to the visible objects in your scene. This gives you a pretty tight fit for your scene in the view frustum and should maximize the use of your depth buffer.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!