Edge cases of a bounding box vs the view frustum

Started by
16 comments, last by Rockoon1 15 years, 4 months ago
So I've implemented the basic view frustum culling algorithm but in my case the edge case of counting bounding boxes completely out of the frustum in is really effecting performance. Here's an image of what I am referring to: With the basic test the orange box is recorded as intersecting. Whats the fastest way to test for this case? Thanks
Advertisement
I would imagine the simplest way would be to calculate a plane which is perpendicular to the far plane and where the far plane intersects with the frustum, and if the box is on the other side of that plane, cull it.

I hope you can understand what I wrote in that last paragraph without a diagram :-)

But I can't imagine there'd be all that many cases where this would actually have any effect... unless your bounding boxes are really huge, which kind of defeats the purpose (use an octree in that case).
in more specific terms I am looking for exact frustum culling of an AABB.

and yeah, the above does make sense and I will implement this but is there a faster way?
well I've researched it and I need to do a Separating Axis Test. I've figured out how to do this for an OBB and OBB but am not sure about a Frustum and an OBB.

Thanks
see:
"Optimized View Frustum Algorithms for Bounding Boxes"

here:
http://www.ce.chalmers.se/~uffe/vfc_bbox.pdf

it contains the fastest AABB-frustum intersection testing algorithm that i know of.
It's outside the frustum when all of the points of the AABB are outside of the same side.
Quote:Original post by Dave
It's outside the frustum when all of the points of the AABB are outside of the same side.


Unless the frustum is inside the AABB...
Hi. Thanks for the replies and these are what I am currently implementing for my basic VF culling.

However let me show you the bug with some screenshots. I've captured what is drawn and the corresponding view frustum. The first screen shot is with the camera directly above the terrain and not rotated. The terrain is made up of concentric rings of increasing size (each ring made of 4 parts). You can see it correctly culls everything. I've also drawn the VF intercepts with the XZ Plane.



However when I rotate the camera as shown here the culling gets all messed up. I am fairly sure this is to do with the corner of the VF case and because my bounding box double in size every ring it causes lots of problems.



Any ideas?
I think it might help if you also draw the bounding boxes. From what I can tell, the bounding box goes around a "ring" of the terrain, so the larger rings' bounding boxes actually go around the entire frustum, hence they're not being culled. That's what you would expect.

I think you need to break the terrain up differently -- i.e. not concentric rings, but instead into blocks. You could still use your current layout, but instead of one bounding box for the whole ring, you have 4 - one for each "side".

At least, that's assuming I'm understanding the situation here...
Hi,

Sorry for not being clear enough. I've updated one of the screenshots to include some quickly drawn bounding boxes. So yeah, I split the rings into 4 rectangles.

This topic is closed to new replies.

Advertisement