I am looking to initially position my Scene's Camera Z-Distance away from a Group in order to make it so that the bounds of this Group will fit into the scene and be as big as possible. The group consisting of a flat plane with some boxes extending towards the camera (think of a bookshelf where the back of the bookshelf is Z=0). The Group and Scene will be varying widths and heights i.e., initial size of bookshelf 100w,50h, scene 1000w 400h.
I initially thought that I could attempt to find the distance using tan(FoV) = sceneHeight / distance;
but that didn't work at all. I have looked at a few examples that approach it that way as well, but to no avail have I got this working. I am wondering if I would have to work with the object's initial height i.e., 300, and compare it to the height I am looking for i.e., 1920.
Any help is appreciated, thank you.