Search Unity

AR Foundation - Distinguish plane types

Discussion in 'AR/VR (XR) Discussion' started by a-bottosso, Sep 19, 2018.

  1. a-bottosso

    a-bottosso

    Joined:
    Nov 13, 2015
    Posts:
    11
    Hello,
    I'm experimenting with AR Foundation.
    How it is possibile to distinguish bwtween horizontal planes and vertical ones?
    I'd like to selectively track one of these type of plane and not both like in the example provided with the AR Foundation package.
    Thanks
    Alex
     
  2. lukasz_pasek

    lukasz_pasek

    Unity Technologies

    Joined:
    Oct 16, 2017
    Posts:
    22
  3. Roberto_Corrales

    Roberto_Corrales

    Joined:
    Sep 25, 2018
    Posts:
    3
    Hi Lukas_pasek, and do you know if there's a way of detecting upside down horizontal planes (ceilings)? Thanks a lot!
     
  4. lukasz_pasek

    lukasz_pasek

    Unity Technologies

    Joined:
    Oct 16, 2017
    Posts:
    22
    @Roberto-Corrale

    You should be able to use BoundedPlane.Normal to detect the 'up' of a plane. In case of a plane on the ceiling, that plane should have normal vector pointing down.
     
  5. a-bottosso

    a-bottosso

    Joined:
    Nov 13, 2015
    Posts:
    11
    Hi @lukasz_pasek
    Thank you so much.
    Do you know if it's possible to retrieve the "BoundedPlane" from the ARRaycastHit?
    I do a raycast to find a plane on which instantiate a prefab, and I'd like to determine the plane type in order to do the correct transformations to place the object in the best way possible.
    Thanks
    Alex
     
  6. Mal_Duffin

    Mal_Duffin

    Joined:
    Jan 22, 2015
    Posts:
    45