I have a squared plane and a camera set perpendicularly to it.
Renderer view is also squared.
The camera could only travel along Z axis from the plane (0 ... infinity). I'm looking for a formula to calculate FOV from updated Z, so the plane would be the same size as renderer view.
And vice versa, to re-calculate camera Z position for a giving FOV, so squared plane would match squared renderer view.
Have tried to play with the formula
var FOV = 2 * Math.atan( planeWidth / ( 2 * camera.position.z ) );
and
var FOV = 2 * Math.atan((aspect) / (2 * camera.position.z)) * (180 / Math.PI); //aspect is 1.0
Without any success. Any ideas?