Jump to content
  • Advertisement

Archived

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

nts

frustum culling, box outside but still inside

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

I have setup frustum culling and it seems to work except for one simple case where all the points of a box are outside the frustum planes but the box is still inside the frustum. What would be the best way to check for this, would I have to calculate out faces and edges for frustum and box and check those (probably slow) or is there a better way of doing this? anybody have any samples of how to do this special check? thanks

Share this post


Link to post
Share on other sites
Advertisement
Use a sphere instead of box for objects bigger than the frustrum.
[edit]
Alternatively, check for the center of the box if it is in the frustrum or not.

[edited by - Raduprv on May 9, 2004 4:44:55 PM]

Share this post


Link to post
Share on other sites
i have done both, sphere check also fails in that case and the center of the box isn''t in view either.

Share this post


Link to post
Share on other sites
actually checking the eye point, how do i check the whole frustum

Share this post


Link to post
Share on other sites
Well, basically, if all the box is outside the frustrum, but also inside of it then check for all the corners of the frustrum vs all the corners of the box...
Can you show a picture (ascii or something) to show the exact situation? (like where is the frustrum and where is the box).

Share this post


Link to post
Share on other sites

The situation is something like the following, so all the points are outside and yet the box should be visible



______________
\ /
.-\----------/--.
| \ / |
| \ / |
.----\----/-----.
\ /
\/
(eye)

Share this post


Link to post
Share on other sites
Then you can try some hack like:
If the object is betwen the close and the far plan, check to see if it is larger than the frustrum, and if one of it''s corners is in the left, and another in the right (left and right of the line perpendicular to the farplane, from the eye)

Share this post


Link to post
Share on other sites

  • 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!