Oh wise and knowledgeable coding community, I come seeking your expertise...
I am working with the three.js library and facing a challenge in implementing a 'show extents' button. This button should adjust the camera position so that all objects in the scene are visible within the camera view (assuming they are not obstructed).
I have been able to determine the bounding box of all objects in the world, represented by coordinates w0x, w0y, w0z and w1x, w1y, w1z.
Could you advise me on how to position the camera based on these bounds to ensure a clear view of the box edges? It is essential to choose a viewing angle for this purpose. Despite my attempts to search for an algorithm online, I have yet to find a suitable solution. Any help would be greatly appreciated!