Camera FOV seems incorrect

I am trying to implement physically correct camera controls (based on lens size, focal length, and f-stop). However I noticed that the camera FOV in Babylon seems incorrect.

As a test, I created a simple scene in Blender (just a cube + light + camera) with a 35mm camera and 50mm focal length. This gives a FOV of 39.60.

However, when I import the GLB into Babylon, it has a FOV of 22.90. If I manually change the camera’s FOV to 39.60 then the result seems wrong (the perspective is slightly off, and the cube is too small).

Here is a sandbox which demonstrates the problem:

https://playground.babylonjs.com/#40ISEF

It overrides the FOV to the correct 39.60. If you comment out the camera.fov = ... line then you will see Babylon’s default FOV.

If I view the same GLB in https://gltf-viewer.donmccurdy.com/ then it has the correct FOV. You have to change the camera to “Camera_Orientation”.

So I see two bugs here:

  1. It is ignoring the FOV which is specified in the GLB file.
  2. When manually setting the correct FOV the result is incorrect.

For reference, here is what the FOV looks like in Blender (it’s the same as the GLTF viewer):

Oh, it seems the editor was screwing up the size. If I remove the editor, then the FOV is correct.

And it seems that Babylon is importing the camera with a vertical FOV (whereas Blender uses a horizontal FOV), which is why the FOV is 22.90 and not 39.60.

So after some more testing, it seems Babylon is correct. Sorry for the noise.

2 Likes