Frustum Culling

Blitz3D Forums/Blitz3D Programming/Frustum Culling

Best way to do frustrum culling would probably be bounding sphere and then an oriented bounding box which is scaled and rotated to fit the object as tightly as possible. I'm not sure how you would calculate that, but I'd try to figure out how I'd do it myself, and then try to construct an algorithm to do the same thing. I'll bet there are papers out there though that explain how to best fit an OBB to a cloud of points.

Anyway, the above code can do that sort of culling. If you make eight quads polygons for the sides of the box and eight for the frustum, and then clip the box with the frustum, if any of the box polygons are not clipped away completely, being completely outside the frustum, then the box is in the frustum. This is plenty fast enough to do if you don't have 100,000 objects in your scene and you do the sphere check first.