Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Custom IPD

Discussion in 'AR/VR (XR) Discussion' started by taxfromdk, Sep 27, 2015.

  1. taxfromdk

    taxfromdk

    Joined:
    Oct 30, 2009
    Posts:
    95
    Hi Guys,

    I have a stereo image with an IPD of 70mm where I would like to overlay a virtual element.

    It seems to me that the new integrated VR support does not expose much customisation and the IPD is stuck at some value around 65mm.

    My question is therefore if anyone knows a way to change the IPD in unity 5.2's integrated VR support.

    Kind regards

    Jesper
     
  2. Poupi

    Poupi

    Joined:
    Jan 11, 2012
    Posts:
    110
    You can put your camera into an empty gameobject and rescale this gameobject to change the world scale in VR (seems similar to changing the IPD).
     
  3. taxfromdk

    taxfromdk

    Joined:
    Oct 30, 2009
    Posts:
    95
    Thanx. Ill give it a go.

    Jesper
     
  4. blindmen

    blindmen

    Joined:
    Sep 10, 2015
    Posts:
    34
    @Poupi
    @taxfromdk

    How to measure what is a current IPD?

    Also if I have 2 cameras LEFT and RIGHT how can I set up IPD correctly?

    Thanks
     
  5. taxfromdk

    taxfromdk

    Joined:
    Oct 30, 2009
    Posts:
    95
    I have not had a chance to give it a go yet, but the theory is that you place them under a common parent and scale the parent.

    If you need an IPD of 80mm you would set the scale to 80mm/65mm=1.23076.

    That is at least what I aim to try next time im near a head mounted display.
     
  6. taxfromdk

    taxfromdk

    Joined:
    Oct 30, 2009
    Posts:
    95
    I think 65 mm is sort of standard so I assume the default is that.
     
  7. EyePD

    EyePD

    Joined:
    Feb 26, 2016
    Posts:
    63
    I did it like this:

    Code (CSharp):
    1.         Vector3 leftEyePosition =
    2.             UnityEngine.XR.InputTracking.GetLocalPosition(UnityEngine.XR.XRNode.LeftEye);
    3.         Vector3 rightEyePosition =
    4.             UnityEngine.XR.InputTracking.GetLocalPosition(UnityEngine.XR.XRNode.RightEye);
    5.  
    6.         Debug.Log(Vector3.Distance(leftEyePosition, rightEyePosition));
     
    sepahyar_unity likes this.