Jump to content
  • Advertisement
Sign in to follow this  

Frustum vs Point

This topic is 3004 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

Hi, I'm implementing a frustum culling algorithm in a vertex shader for OpenGL (using GLSL) and I have a problem with the equations (don't work as planned). Here's the algorithm : I have : -pos is the center of the aabb -l is the length of the aabb -Mp is a projection Matrix -Mm is a ModelView Matrix -pt = Mp * Mm * pos; (So it's the transformed position of the center) Pt is in the frustum if ALL the following assertions are wrong : - pt.x + l/2 < -pt.w; - pt.x - l/2 > pt.w; - pt.y + l/2 < -pt.w; - pt.y - l/2 > pt.w; - pt.z + l/2 < -pt.w; (Note : for directX, it's pt.z + l/2 < 0 ) - pt.z - l/2 > pt.w; But it's not working properly, some objects get culled even though they are still visible. Have I done something wrong ? Regards, B [Edited by - at0m on April 27, 2010 11:00:25 AM]

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!