Search Unity

Access to Video Camera

Discussion in 'AR' started by hydeoger, Jun 29, 2018.

  1. hydeoger

    hydeoger

    Joined:
    May 19, 2016
    Posts:
    5
    Hi,

    i need to access to the video camera of the device without the AR superimposing, only the video background image in order to visualize it on a RawImage.
    I searched in this forum but i have not found a solution.

    Someone help me?

    Thanks.
     
  2. hydeoger

    hydeoger

    Joined:
    May 19, 2016
    Posts:
    5
    i solved the problem:

    1) Add UnityArVideo script on the ArkitCamera
    2) Create a Material (Unlit/ARcameraShader)
    3) Reference the Material to UnityArVideo material field
    4) Add a RawImage in your canvas and add the created material
     
  3. dmitry-K

    dmitry-K

    Joined:
    Apr 2, 2014
    Posts:
    26
    Could you please show some script reference how you did it ?
     
  4. todds_unity

    todds_unity

    Joined:
    Aug 1, 2018
    Posts:
    324
    Hi Dmitry-K,

    For Hydeoger's instructions, all of the required scripts are included in the Unity ARKit plugin. Hydeoger's instructions are the steps to be followed inside the Unity Editor to hook up the scripts, the camera, and the game objects.

    Todd
     
  5. troloo

    troloo

    Joined:
    Feb 12, 2019
    Posts:
    1
    If I would like to be able to sale the image of the AR session on my device, is this the best way to do it?

    An example of what I want to do is already possible by using the iphone accessibility zoom feature while my AR app is running. I can then zoom in and out of the image on my phone. I would like to be able to control this zoom in my app.

    For example zoom image X2, zoom image X3 etc... This is nothing to do with the AR camera focal length or FOV just a simple 2D scale of the image I am looking at on my phone. This is why it sounds like the above method might work.

    Please let me know what you think.