Archived

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

XBTC

Whats the best(fastest) way to check if a box is inside the V-Frustum?

Recommended Posts

Yes,I have an axis-aligned bounding box,defined by bmin[3] and bmax [3](the vertex with the lowest x,y,z value and the one with the highest)and the planes(defined by normal and distance) of my view-frustum.How do I check if the bounding-box is inside the frustum? I thought about it a little and came up with this solution: If all 8 corners of the bbox are completely outside of one of the frustum´s planes,then the box is outside of the frustum. This even avoids the following case:The player stands directly before the bbox and looks at it,so that all corners of the box are outside the VFrustum,but the middle of the bbox is still inside the frustum. This should work but I think it would be way to slow.To test 8 vertices against 4 planes results in 32 tests in the worst case(all points outside the last test-plane)which is simple to much. So how is it done in the good engines? Thanx in advance,XBTC! P.s.:A sphere frustum test would be much faster,but not so precise,but I guess there is a reason that all quake´s use bboxes.

Share this post


Link to post
Share on other sites