Suppose I have a radius for a spherical bounding box around a mesh.
My goal is to render the scene such as when the camera moves, the bounding box whose centre the camera look at, occupies always more or less the same space. To do so I'm changing the FOV of the camera when it moves, in particular I do:
FOV = 2 * arctan(radius/distance)
which is the value I feed to
glm::perspective after the conversion to degrees.
whereas the distance is obtained by
distance = glm::distance(BBCentre, cameraPosition)
The problem is that when the distance becomes small it is like zooming out the object. For bigger distances, although the object does not occupy the portion of screen I was expecting, it doesn't move.
Am I doing something wrong here?