Change FOV of DualCamera (left and right)

SOLVED
pablocael
Explorer

Change FOV of DualCamera (left and right)

Hi there,

 

Im currently using OpenCV to track markers from VIVE Pro camera. Ive been sucessfull so far and Im working in an integration script. However, the reconstructed FOVY from images is about 33.12 degrees and currently DuaCamera Left and Right have 110.05 FOVY that cannot be changed.

 

Is there any way of changing it? Thanks

Vive Staff
Solution

Re: Change FOV of DualCamera (left and right)

Hi pablocael,

 

The user cannot change the field of view during runtime, because this behaviour is known to induce motion sickness. from Unity document VR overview.

 

from my opinion, there are 3 ways to do what you want.

1. create another camera which FOV was set and attached "Target Texture". put a quad showing that texture in front of main camera.

2. use post rendering.

3. disable VR setting and create your own vr system.

 

Highlighted
pablocael
Explorer

Re: Change FOV of DualCamera (left and right)

Thanks. 

Using my own camera set to mainCamera works. If you set as LEFT or RIGHT the sistem changes fov.

 

Now Im struggling to be able to access the final device texture. I realize that the final displayed scene is not equal to the preview of the Dual Left or Right cameras. It has some cropping. The final device texture is 1535 by 1706 and its just a crop part of the full ImagePlane quad.

 

Can I know which rectangle (and its center) of the quad is used? I manage to manually set a orthographic camera that can generate exatcly the same rendertexture (with maybe 1 pixel or so different since it was set manually) from the final game screen. But since it is a render texture, it is kind of slow to access it as a Texture2D. Since I already have a Texture2D of undistorted image, it would be easier to just crop it if I knew exatly the scale / crop center of the final device texture.

 

Can it be found in any easy way? 

 

Thanks

Vive Staff

Re: Change FOV of DualCamera (left and right)

Hi pablocael,

 

please try calling

GetRecommendedRenderTarget(ref uint pnWidth, ref uint pnHeight) of openvr.cs