Auto-focus a spatial

Hi,



I'm looking for a way to auto-focus a spatial, i.e. position the camera in front of it so that I can take a picture without cutting parts out. Basically I would point the the camera to the spatial and move it backwards enough to get it completely. Now, how far ?



The aim is to create an icon view of the many spatials I have in my graph.



Hints ?

You have the view frustum and the height of the spatial ( BoundingBox ).



The rest ist simple trigonometry.

:smiley: right!



Let me see how simple trig can be of help…