Search code examples
math3dfrustumcullingglfrustum

Create a tight frustum around a 3D model bounding volume


Tight frustum

I intend to create a tight frustum around a 3D model:

Frustum schematics

I have these variables:

  • Inputs:
    • 3D model bounding box or bounding sphere or bounding volume.
  • To be determined:
    • Eye distance and location.
    • Up vector.
    • Vertical field of view in degrees.
    • Near plane.
    • Far plane.
    • ...?

Question

How can I determine my variables so that the frustum would be tightly surrounding the 3D model? I'm looking for some approaches, algorithms, or even keywords and terminology.

Looks like there is Frustum Culling approach to figure out if a bounding volume is on a frustum. But what I want is kind of reverse of that. I want to create a tight frustum around a bounding volume. I'd appreciate any hint or help.


Solution

  • Estimating the eye distance by max dimension of b-box and the fovy angle might help:

    enter image description here