Want to know if they are correlated to each other
I realise it's been a long time since this question was asked (to say the least), but I had a good diagram hanging around and it seemed a shame not to post it since I think it's helpful here. As evidenced by the diagram, the relationship between the field-of-view (theta
) and the distance to the image plane (d
) is:
tan(theta/2) = ymax/d
"lens length" has no meaning. The "lens" in OpenGL and DirectX is a pinhole camera and hence has no size (ie it is infinitesimally small).
If you are talking about focal length then again this has no relation as a focal length implies a lens as well as depth of field.
You can however calculate the camera position in relation to the screen in whatever units you like (This was taught to me as the "Perspective Reference Point").
Lets say the screen is 1 meter wide and the FOV is 90 degrees (PI/2 radians). Using basic trigonometry you know that
tan( fov / 2 ) = opposite/adjacent.
You know opposite (as it is half a meter, ie half the screen)
So to calculate adjacent (ie the distance from the screen to the camera position) you simply do:
adjacent = opposite / tan( fov / 2 )
With the simple numbers above this goes to:
adjacent = 0.5 / tan( PI / 4 )
=> 0.5 / 1.0
=> 0.5
ie in that case the camera would be half a meter away from the screen (Quite logical when you think about a 90 degree field of view).
The units involved are, of course, somewhat arbitrary ...
If you then look into it. The closer the camera position to the screen the wider the FOV and equally the further the camera position the narrower the FOV. If you draw these out you will see exactly why.
From this basis you can calculate the perfect FOV for a person sat "n" meters away from the screen ...
Think of a horizontal line of unit length at distance d from the camera, of which the field of view (i.e. the opening angle) is set so that the unit long line at distance d covers exactly the image width (or height, depending at what you measure the field), then d is the lens length. And you can of course take the inverse calculation, too.
tan(0.5 fov) = 0.5 d
© 2022 - 2024 — McMap. All rights reserved.