Added logic to compute the zoom level given the camera distance