Zoom in and out on an object VR Cardboard
Hello, i'm working on a virtual museum with google cardboard and i want to be able to zoom in and out on a painting with a controller button. (I'm using xbox controller for movement and interaction.)
Answer by EthanFischer · Sep 19, 2016 at 02:49 AM
I am also wondering how to implement zoom functionality in my Cardboard app. Help please!
I've tried editing the Field of View property in GvrEye, fruitlessly :( It's the only class in my project I can find that mentions field of view.
Edit: Aha. Found it.
Attached to my Camera is a script called Stereo Controller. After searching for "zoom", I found the following description of the matchMonoFOV property.
/// Determines the method by which the stereo cameras' FOVs are matched to the mono /// camera's FOV (assuming #matchMonoFOV is not 0). The default is to move the stereo /// cameras (#matchByZoom = 0), with the option to instead do a simple camera zoom /// (#matchByZoom = 1). In-between values yield a mix of the two behaviors. /// /// It is not recommended to use simple zooming for typical scene composition, as it /// conflicts with the VR need to match the user's head motion with the corresponding /// scene motion. This should be reserved for special effects such as when the player /// views the scene through a telescope or other magnifier (and thus the player knows /// that VR is going to be affected), or similar situations.
If you want to manually tweak your cameras zoom/FOV, set the 'matchMonoFOV' to 1 (it's a public property, so you can use the slider from the Unity editor). Then just set your cameras FOV property to whatever you desire (again, you can use the slider). Hope this helps someone.