Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to change FOV of the google card board camera

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

like image 727
user3839742 Avatar asked Jan 19 '15 12:01

user3839742


2 Answers

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.

like image 53
smd Avatar answered Nov 06 '22 17:11

smd


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);
like image 1
walt Avatar answered Nov 06 '22 17:11

walt