Unable to change FOV of the google card board camera

跟風遠走 提交于 2021-02-07 03:35:42

问题


I am developing a sniper game for android using Google card board unity SDK. Now there is the need to tweak the camera's FOV which leads me to interact a variable named 'mockFieldOfView' in CardBoard.cs. Tweaking that value in the Unity editor is fine but as soon as I make a build for Android it doesn't take effect at all. I'm unable to figure out the issue. Any idea or suggestion would be highly appreciated.

Apologize for the late reply, so ouflak you can see complete Cardboard.cs here Cardboard.cs


回答1:


You don't want to change "mockFieldOfView". That only affects the in-editor FOV. The value you want to change is "matchMonoFOV" on the StereoController. You also have to set a "CenterOfInterest" game object on the StereoController. It makes the stereo FOV attempt to match the FOV on the Main Camera (or whichever camera has the StereoController script).

See StereoController.cs

Update: v0.4.5 of Cardboard SDK supports your use case. Use "matchByZoom" and set the FOV you want on the StereoController's camera. No center of interest is needed.




回答2:


I had the same issue and in my case it helped to put the MainCamera closer to the object which was the Cockpit of a car in my case.

In order to put the MainCamera closer than 1 real-world-meter to the object you must change the default-minimum-value in Cardboard.cs - I use the following setting:

private readonly Vector2 defaultComfortableViewingRange = new Vector2(0.0f, 100000.0f);


来源:https://stackoverflow.com/questions/28024935/unable-to-change-fov-of-the-google-card-board-camera

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