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
PDK Issue with Setting camera FOV
- Rob McCarthy
- Lockheed Martin
- Posts: 3703
- Joined: Wed Aug 24, 2011 1:37 pm
Re: PDK Issue with Setting camera FOV
Hello,
Can you post more details or perhaps a code sample of how you are making this call?
Regards,
Rob McCarthy
Can you post more details or perhaps a code sample of how you are making this call?
Regards,
Rob McCarthy
Rob McCarthy
Prepar3D® Core Lead
Prepar3D® Core Lead
- Beau Hollis
- Lockheed Martin
- Posts: 2452
- Joined: Wed Oct 06, 2010 3:25 pm
Re: PDK Issue with Setting camera FOV
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.
Thanks
Thanks
Beau Hollis
Prepar3D Software Architect
Prepar3D Software Architect
-
- Posts: 36
- Joined: Tue Aug 04, 2015 7:51 pm
Re: PDK Issue with Setting camera FOV
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?
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?
- Beau Hollis
- Lockheed Martin
- Posts: 2452
- Joined: Wed Oct 06, 2010 3:25 pm
Re: PDK Issue with Setting camera FOV
Do you get the same result with wide-view-aspect checked or unchecked in UI?
Beau Hollis
Prepar3D Software Architect
Prepar3D Software Architect