How can I place Camera to show all objects?

you find some code and pointers here: Camera Zoom To Fit Object - #35 by pinki generally, search for “zoom to fit”.

it’s still a complex issue and i’ve not been able to find code that suits all usecases, camera types (orthographic/oerspective), animated. i’ve searched through all forums i knew, stackoverflow, etc.

scraped every bit of info i could find together to form a magic bullet component for react + three: <Bounds/>, and here’s a demo: Bounds and makeDefault - CodeSandbox but it’s open source, if the discourse link above isn’t enough you can cross check the components source.