Page 1 of 1

PDK Issue with Setting camera FOV

Posted: Fri Nov 16, 2018 9:03 pm
by srgriffiths
For some reason when I try set the camera fov it doesn't get set to the desired values. Are there FOV restrictions? It is strange that the hfov get sets to the desired vfov. Any thoughts?

hfov_desired = 65.841419512000968;
vfov_desired = 40.021835855776025;

pCamera->SetFov(hfov_desired, vfov_desired); //For some reason the camera doesn't get set to what I tell it to.

pCamera->GetFov(hfov_actual, vfov_actual);

hfov_actual = 40.0218353
vfov_actual = 23.1542664

Re: PDK Issue with Setting camera FOV

Posted: Tue Dec 04, 2018 1:18 pm
by Rob McCarthy

Can you post more details or perhaps a code sample of how you are making this call?

Rob McCarthy

Re: PDK Issue with Setting camera FOV

Posted: Tue Dec 04, 2018 2:29 pm
by Beau Hollis
Because default cameras use zoom rather than FOV to set up their projection, the GetFOV() function does not simply pull the fov values from data members. It extracts the fov from the projection matrix. The projection matrix is build from FOV, SideAngles, or Zoom/Aspect during the camera update. If you set the fov in the OnPreCameraUpdate() and get it in OnPostCameraUpdate(), the values should match unless another plugin is setting the FOV or SideAngles. If you're in VR for example, our VR system sets SideAngles via the PDK. Can you be more specific about the camera you are modifying? If it's a custom camera, SimdDirector camera, Observer, or part of a view group, there could be other systems trying to modify the FOV.


Re: PDK Issue with Setting camera FOV

Posted: Thu Dec 13, 2018 5:42 pm
by srgriffiths
OnPreCameraUpdate, SetFov
hfov 33.7883224 float
vfov 19.3894024 float

OnPostCameraUpdate, GetFov
tmp_hfov 19.3894043 float
tmp_vfov 10.7491159 float

Isn't it odd that the hfov is what I set the vfov to be?

Re: PDK Issue with Setting camera FOV

Posted: Sat Dec 15, 2018 12:18 am
by Beau Hollis
Do you get the same result with wide-view-aspect checked or unchecked in UI?