<p>Estimating the eye distance by max dimension of b-box and the <code>fovy</code> angle might help:</p>
<p><a href="https://i.sstatic.net/7IcdL.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/7IcdL.jpg" alt="Schematics" /></a></p>

CC BY-SA 4.0
2024-02-23T14:21:31.233Z
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.
pmw1234
CC BY-SA 4.0
2024-02-24T03:24:31.857Z
@pmw1234 Thanks. Makes sense. I'm going to implement and test if there is a chance.
Megidd
CC BY-SA 4.0
2024-02-24T11:44:36.013Z
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.
pmw1234
CC BY-SA 4.0
2024-02-22T12:09:53.513Z
2024-02-22T12:09:53.513Z
Megidd
<h1>Tight frustum</h1>
<p>I intend to create a tight frustum around a 3D model:</p>
<p><a href="https://i.sstatic.net/2F4K8.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/2F4K8.png" alt="Frustum schematics" /></a></p>
<p>I have these variables:</p>
<ul>
<li>Inputs:
<ul>
<li>3D model bounding box or bounding sphere or bounding volume.</li>
</ul>
</li>
<li>To be determined:
<ul>
<li>Eye distance and location.</li>
<li>Up vector.</li>
<li>Vertical field of view in degrees.</li>
<li>Near plane.</li>
<li>Far plane.</li>
<li>...?</li>
</ul>
</li>
</ul>
<h1>Question</h1>
<p>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.</p>
<p>Looks like there is <a href="https://learnopengl.com/Guest-Articles/2021/Scene/Frustum-Culling" rel="nofollow noreferrer">Frustum Culling</a> 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.</p>

CC BY-SA 4.0
2024-02-22T10:38:45.907Z
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.
Megidd
<opengl><transformations><mesh><camera><bounding-volume-hierarchy>
Create a tight frustum around a 3D model bounding volume
Megidd
# Create a tight frustum around a 3D model bounding volume

(Asked by: username_0 on 2024-02-22)

# Tight frustum

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

[![Frustum schematics](https://i.sstatic.net/2F4K8.png)](https://i.sstatic.net/2F4K8.png)

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](https://learnopengl.com/Guest-Articles/2021/Scene/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.

**Tags:** opengl, transformations, mesh, camera, bounding-volume-hierarchy

> **Comments:**
> **username_0**: 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.  

---

## 1 answers

### Answer by username_0 on 2024-02-22. Score: 0 | Accepted answer

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

[![Schematics](https://i.sstatic.net/7IcdL.jpg)](https://i.sstatic.net/7IcdL.jpg)

> **Comments:**
> **username_1**: 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.  
> **username_0**: @username_1 Thanks. Makes sense. I'm going to implement and test if there is a chance.  
> **username_1**: 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.  

---

