Hi,

How can I calculate the optimal distance from a object for the camera eye-point such that all of the object is visible on screen (assume that the camera is axis aligned and that I only care about the x width of the object to look at).

As a follow up, given a cylinder of radius R, how can I calculate the optimal camera distance such that the end section (circular) of the cylinder is completely visible on screen?

Thanks for any help you may be able to give.