How to change Field of View in Google VR SDK for Unity

混江龙づ霸主 提交于 2019-12-23 05:47:14

问题


I created a AR stuff with Google VR SDK for Unity and NyARToolkit (http://nyatla.jp/nyartoolkit/wp/?page_id=198).

Current AR screen of application, however, is not fullscreen. I wanted to change Field of View of "Camera Left" and "Camera Right", but these didn't effect on screen. How should I change to fullscreen?


回答1:


To change the Field Of View of Google VR SDK, folow these steps :

1) First select the Main Camera in GVR Main

2) Make changes to Stereo Controller Script from Inspector (Change values of Match Mono FOV & Match By Zoom according to your requirements)

3) Now run scene and change Field Of View value of Main Camera, and you will see effect on screen.

Hope this will help. Thanks.




回答2:


I used Legacy/Prefabs/GvrHead. I set "Match Mono FOV" to 1 and "Match By Zoom" to 1 in Stereo Controller option. It works well.




回答3:


Also ran into this problem weeks ago. Sometimes, you have to modify the stereoMultiplier too. Here is a simple function I use to fix this problem:

void fixFieldOfView(float stereoMultiplier = 1, float zoom = 0f, float fov = 0f)
{
    StereoController stereoCtrl = GvrViewer.Controller;
    stereoCtrl.stereoMultiplier = stereoMultiplier;
    stereoCtrl.matchByZoom = zoom;
    stereoCtrl.matchMonoFOV = fov;
}

Usage:

fixFieldOfView(1, 1, 1);


来源:https://stackoverflow.com/questions/40340898/how-to-change-field-of-view-in-google-vr-sdk-for-unity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!