6
$\begingroup$

I get the settings of the camera I have to use in FOV angle unit(both horizontal and vertical). How to set it in Blender? In Blender you can only insert one FOV. I assume that is the horizontal FOV and how can you set the vertical one? Can anyone help me? Thanks in advance

$\endgroup$
  • $\begingroup$ You set it indirectly by specifying a rendering resolution. $\endgroup$ – maddin45 Jan 19 '15 at 13:05
  • $\begingroup$ What do you mean by that? Does it mean that I can change both the horizontal and the vertical FOV even without changing the sensor size, focal length? $\endgroup$ – JianNius Jan 19 '15 at 14:29
4
$\begingroup$

I have found that the dimension along which the FOV applies depends on the image aspect ratio. Let us define the aspect ratio as the ratio of width / height, such that an aspect ratio larger than 1 means that we are in a landscape configuration.

if aspect ratio > 1.0 
  FOV is along width.
else
  FOV is along height.

You can verify this by setting your image dimensions to, for example, X:2000; Y:1000, and Camera lens FOV:90°. Switch to ortho views and check the representation of the camera against the grid. See the following screenshots:

FOV along image width

FOV along image height

With that in mind, you can use specific FOV values. Remember that values going into and out of trigonometric functions have to be converted to and from radians. I use vfov to mean the required vertical FOV and hfov to mean horizontal FOV.

A. To specify the vertical FOV:

  1. If your image is portrait or square:

    • just set the wanted value in the FOV field.
  2. If your image is landscape:

    • Use FOV = 2 * atan((0.5 * width) / (0.5 * height / tan(vfov/2)))

B. To specify the horizontal FOV:

  1. If your image is landscape or square :

    • just set the wanted value in the FOV field.
  2. If your image is portrait:

    • Use FOV = 2 * atan((0.5 * height) / (0.5 * width / tan(hfov/2)))

(Note that you can simplify a bit if you compute the aspect ratio first)

Explanation:

  1. We first find the focal length (in pixels) according to the required FOV, for example:

    f = 0.5 * height / tan(vfov/2)

  2. We use this to find the FOV along the other dimension.

    hfov = 2 * atan((0.5 * width) / f) thus,

    hfov = 2 * atan((0.5 * width) / (0.5 * height / tan(vfov/2)))

Example:

We need a 90° vertical FOV on a landscape image of 2000×1000px.

  1. vfov in radians = 90° * pi / 180° = 1.5707… rad.
  2. hfov in radians = 2 * atan((0.5 * 2000) / (0.5 * 1000 / tan(1.5707/2))) = 2.2142… rad.
  3. hfov in degrees = 2.2142 * 180° / pi = 126.87°.

Result: Specifying vfov in landscape

$\endgroup$
  • $\begingroup$ This should be the accepted answer. Brilliant effort. The other answer is plain wrong. $\endgroup$ – Martijn Courteaux Apr 17 at 8:20
7
$\begingroup$

The FOV camara parameter is for setting the horizontal FOV. You get the vertical FOV by dividing with the image aspect ratio.

Say you image is 1:1 aspect ratio, then the vertical and horizontal FOV will be the same.

If your FOV is 2:1, then the vertical FOV is half the horizontal value.

So, it's Horizontal FOV / aspect ratio = vertical FOV.

If your aspect ratio is 16:9, you must multiply by 0.5625 (because 9/16=0.5625)

$\endgroup$
  • $\begingroup$ Say if I have set the FOV camera parameter to something like 60 grad. The default value of ratio in Blender is 1:1. Does that mean that the my vertical FOV is 60 grad too? Thanks in advance. $\endgroup$ – JianNius Jan 19 '15 at 15:03
  • $\begingroup$ No, the default aspect ratio is 16:9. The value called Aspect Ratio in Blender is not actually the aspect ratio, but the PIXEL aspect ratio, which is the aspect of the pixels (only relevant for old TV's) Aspect Ratio is is width/height of the image. If you are using 1920*1080 you ratio is 16:9 $\endgroup$ – Billrey Jan 19 '15 at 15:31
  • 4
    $\begingroup$ Em. Thanks but I think your equation is a bit wrong. You should've used the trigonometry for counting the aspect ratio. I just fount the website that shows that. Thanks pcgamingwiki.com/wiki/File:Fov_diagram.png $\endgroup$ – JianNius Jan 19 '15 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.