I'm trying to write a formula to pan the camera enough so that an object is just visible at the edge of the screen.
So, in other words if the object is out of view to the right, I would change the x and y position of the camera, so that the object is just at the right edge of the screen (without changing camera angle or z co-ordinate).
Any tips how to do this would be greatly appreciated.
cheers,
Ed