Search Unity

Vuforia Zoom in

Discussion in 'Vuforia' started by anarhist1994, Dec 8, 2017.

  1. anarhist1994

    anarhist1994

    Joined:
    Sep 27, 2016
    Posts:
    32
    Hey,

    I'm trying to implement a Zoom-in feature on my app,
    I tried to override the field of view of the camera but it won't work because Vuforia overrides too.

    I've tried to manually see how Vuforia overrides it and as far as I got is finding this code:

    Code (csharp):
    1.  
    2.   void Awake()
    3.     {
    4.         GetComponent<Camera>().fieldOfView = 90f;
    5.     }
    6.  
    I'd love to know where Vuforia overrides the variables of the camera so I can try and implement this myself.

    Thanks.
     
    Walbert-Schmitz likes this.
  2. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    Hello @anarhist1994

    Vuforia overrides the Field of View value to optimize the AR experience. While it is possible to zoom in your camera, it is not recommended as the SDK is optimized for use with the default zoom level of the device's camera.

    Thanks
     
  3. justdizzy

    justdizzy

    Joined:
    Mar 8, 2016
    Posts:
    89
    So how does one manually change the FOV? I am using Vuforia in a stereoscopic VR (no passthrough video) engine, and when I try like the OP, I get a warning/error "Cannot set field of view on this camera while VR is enabled."

    I am using Unity 2017.3.1p2
     
  4. michelattin

    michelattin

    Joined:
    May 28, 2018
    Posts:
    4
    how can i zoom in my AR camera.can i use unity pinch zoom script with AR camera
     
  5. theolagendijk

    theolagendijk

    Joined:
    Nov 12, 2014
    Posts:
    117
    hi @michelattin,
    your end user can of course zoom in to an augmentation by moving closer to your trackable. this is a very intuitive way of interacting with AR content. but an alternative solution might be to use the pinch gesture to set the scale of your augmentation. This way you can zoom in on the augmentation without changing your physical distance to your trackable.
     
    meedabit and Vuforia-Strasza like this.
  6. michelattin

    michelattin

    Joined:
    May 28, 2018
    Posts:
    4
    suppose i want to detect an image which is at a distance ,can i zoom in my ar camera like normal camera to detect the image?
     
  7. meedabit

    meedabit

    Official Vuforia Employee Vuforia

    Joined:
    Dec 8, 2016
    Posts:
    266
    Hello,

    Camera zoom is not a feature that Vuforia supports. Zooming the camera fundamentally changes the intrinsic parameters of the camera, specifically the focal length, which degrades the accuracy of tracking.

    Thanks,
    Vuforia Engine Support
     
  8. michelattin

    michelattin

    Joined:
    May 28, 2018
    Posts:
    4
    okay thanks for the reply.