Notifications
Clear all

[Closed] Viewport User/Camera Ortho FOV inconsistency

Hi guys,
I need to rebuild the gw.transPoint function to make it work relative to a transform matrix different from active viewport. In the process I need to query the FOV of current USER viewport, but it reports an incorrect value, as a matter of evidence. To understand what I mean, you can run a little test:

  1. Reset the scene.
  2. In perspective view snapshot a camera with CTRL + C
  3. Set the camera to Orthographic Projection. If has a default horizontal FOV of 45.
  4. Switch to User View by pressing U. The view appears to be the same.
  5. Query the User viewport FOV with getViewFOV(). The result is 19.9057 on my machine.

By testing evidence, running the rest of the script, the right value is 45 degrees. So, what’s wrong? How do I get the correct User viewport FOV without creating a camera?

Thank you very much.

  • Enrico
4 Replies

Hi Enrico,

I tried what you mentioned.

In my case the camera with fov and ortho projection gives me the fov 13.5605
now if i press ‘U’ to make it USER view and test fov again it still gives me 13.5605

Thanks Ravi for the test, but I’m afraid you didn’t get it right. The standard camera created in a new scene has a FOV of 45 degrees. You can see it in the Command Panel. When you activate the Ortographic Projection, the viewport looks almost the same and the FOV is still 45 degrees in Command Panel, but if you query the viewport FOV with getViewFOV() you get a different value.

I run some tests and seems the FOV report for User viewports is completely screwed. I hope someone can prove I’m wrong.

  • Enrico

from the reference:

if you reset max and go to any standard ortho view (ie. top / front etc) you will see that the above statement is correct, otherwise it changes depending on your zoom level. I can’t see a predictable relationship between the degree / radian values though, maybe you can?

Hi Joel,
you’re right about standard ortho views like top, front, left, but I’m referring to User, which is not aligned to any standard world axis and uses Orthographic Projection, like the option in Cameras. I don’t know why they give 1 radian as result for standard orthos, I think it’s like a default answer, as it doesn’t have any particular meaning to me for such views too.

In User views getViewFOV() gives meaningless results for me. They’re different form those obtained by a camera in ortho mode for the exact same view (which are the right ones), and I cannot find any kind of relation between these two values. In example, camera fov: 45 degs, viewport fov: 19.9057 degs, granted the Focal Distance remains the same.

  • Enrico