Wrap frustum around an object? 🎥

Hey,

I’m developing an app that showcases a few objects in 3D space. As the users clicks through an interface to preview said objects, I need each object to fill the camera’s frustum. I already figured out how to center the objects in the view but they are too far away / small on screen. Any tips or resources?

EDIT: for orthographic camera !

Check out how the camera is configured in the following viewer: https://gltf-viewer.donmccurdy.com/

The idea is to make the adjustments based on the bounding box of your loaded object. The relevant code is:

3 Likes

Sorry I forgot to mention this is for an orthographic camera display. I will update the thread title… thank you for this but moving an orthographic camera’s position will have no effect on scale of the objects shown.

You might want to adjust the zoom property instead. This is the way how OrbitControls implements dollying (zooming) with an orthographic camera.