0
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ My eventual goal is to take a screenshot of the 3D model. I'm currently taking the screenshot, but the 3D model doesn't fit my final image tightly. $\endgroup$
    – Megidd
    Feb 22 at 10:38

1 Answer 1

0
$\begingroup$

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

Schematics

$\endgroup$
3
  • 1
    $\begingroup$ Compute the six planes of the frustum and adjust them to the maximum vertex positions intersecting each plane. The final frustum can be extracted from the intersections of the planes. $\endgroup$
    – pmw1234
    Feb 23 at 14:21
  • $\begingroup$ @pmw1234 Thanks. Makes sense. I'm going to implement and test if there is a chance. $\endgroup$
    – Megidd
    Feb 24 at 3:24
  • 1
    $\begingroup$ The distance of the camera to the near plane will change in the process, it may end up behind the camera and the distance from the camera to the near plane will change so the near plane and the camera may need to be adjusted to fit. Such as moving the near plane closer to the camera and/or moving the camera closer/further to the near plane. $\endgroup$
    – pmw1234
    Feb 24 at 11:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.