Search Unity

Zoom in and zoom out on Cardboard Panorama

Discussion in 'AR/VR (XR) Discussion' started by kopolipo, Jan 6, 2017.

  1. kopolipo

    kopolipo

    Joined:
    Nov 30, 2016
    Posts:
    4
    Hi guys,
    I'm a newbie in Unity and I'm making a simple android app with a preloaded panorama. I have a problem in implementing the zoom!
    I want to use a simple zoom (changing the FOV) with the head movement, like going forward to zoom in and backward to zoom out but for the moment I'm trying to figure out to do it with the cardboard trigger.

    This is what i did so far:

    1_ The default FOV of the Main Camera is 60.

    Screenshot (6).png

    2_ When i click to simulate the trigger, the FOV decreases by 2 everytime i use it and it works on the Main Camera Preview as you could see

    Screenshot (7).png

    3_ The default FOV of the Main Camera Left/Right is 97 and it decreases as well as it should but on the camera preview it doesn't. It seems like it doesn't apply the upgrades.

    Screenshot (8).png

    I just used the GvrViewer, GvrGaze and GvrReticlePointer scripts on the Main Camera.
    Then I modified the GvrGaze script with these code lines:

    Screenshot (9).png

    I hope you could help me, I don't know what to do guys
    Thanks in advance!
     
  2. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    I'm not sure that changing FOV for an HMD is a good thing. Have you tried changing the scale of the camera?
     
  3. kopolipo

    kopolipo

    Joined:
    Nov 30, 2016
    Posts:
    4
    Yeah, the resolution is really bad when i change it
     
  4. kopolipo

    kopolipo

    Joined:
    Nov 30, 2016
    Posts:
    4
    Guys, I fixed the problem putting in the StereoController the scene _46.80... as a Center of Interest and matchByZoom=1.
    It works great, whenever i click on the Game it zoom, but when i run the app on my phone the trigger does NOTHING.
    Did you have an issue like this?
     
  5. Brian-Kehrer

    Brian-Kehrer

    Joined:
    Nov 7, 2006
    Posts:
    411
    Have you also adjusted matchMonoFOV?
     
  6. kopolipo

    kopolipo

    Joined:
    Nov 30, 2016
    Posts:
    4
    Yes I did! matchMonoFOV=1
    I don't understand why, maybe they removed the magnetic trigger support on the new SDK? It makes no sense