# Camera Problems!

Hi all!!
How does one find the focal length of the camera in GL? (it changes and depends on prespective i know!)
But how do i find out what it is?? esp given just PROJECTION and MODELVIEW matrix?
I need it to work out an Algorithm called POSIT

Thereâ€™s really no focal length in the OpenGL camera model; itâ€™s a perfect pinhole (aperture = 0).

There are many examples of simulating lens effects, however. Try a search for â€śdepth of field,â€ť for example.

Iâ€™m not entirely sure this is what youâ€™re after, but I hope it helps.

Donâ€™t confuse focal length with depth of field.

When this question is asked the poster is typically asking for the field of view as it correlates with some camera system (usually 35mm SLRs).

You can find this information online, but make sure itâ€™s the right information for the camera system you have in mind. Google threw this up, it seems like itâ€™s the kind of calculator you need:

http://www.dudak.baka.com/fovcalc.html

Note that you donâ€™t have to fully populate the boxes and for your purposes some fields are irrelevant. Keep the 35mm, type in the focal length and click calculate FOV and the end column will give you the degrees. Note that this is the diagonal angle, you could use a distance and take 2 * atan(long_side/focus_distance) to get the horizontal fov (use any value to seed the focus_distance) Of course short_side would give you vertical FOV (at least for a landscape orientation. ).

Hey Dorbie,

When this question is asked the poster is typically asking for the field of view as it correlates with some camera system (usually 35mm SLRs).
Yeah, I wasnâ€™t sure where to go with this after a brief scan of the POSIT algorithm (I havenâ€™t seen any questions in this area). So I thought Iâ€™d just throw something out there to get the ball rolling. Thanks for the suggestion.