Search Unity

ARKit Vertical and Ground Planes

Discussion in 'AR' started by joduffy, Mar 30, 2018.

  1. joduffy

    joduffy

    Joined:
    Jul 30, 2011
    Posts:
    34
    Hi Guys,

    I created a simple scene to test Vertical and Ground planes, as well as feature points in ARKit.
    I used the sample scene given with the ARKit unity plugin as a template to work from:

    AddRemoveAnchorScene

    I created 3 scripts and changed the ARHitTestResultType to reflect each element I wanted to test. For example, using the following for ground planes:

    Code (CSharp):
    1.                 // prioritize reults types
    2.                 ARHitTestResultType[] resultTypes =
    3.                 {
    4.                     ARHitTestResultType.ARHitTestResultTypeEstimatedHorizontalPlane
    5.                 };
    Using the following for vertical planes:


    Code (CSharp):
    1.                 ARHitTestResultType[] resultTypes =
    2.                 {
    3.                     ARHitTestResultType.ARHitTestResultTypeEstimatedVerticalPlane
    4.                 };
    With the above, I should be able to spawn different gameObjects for each hit type detected. But what I am seeing is that the gameObjects for both Vertical and Ground planes are created on the planes, regardless of the filter.

    IMG_7691.PNG

    So in the above image. I have blue spheres for vertical planes, red boxes for ground planes, and green capsules for feature points. But you can see that for the most part, they are spawning together, rather than filtering out depending on plane type.
     
    ROBYER1 likes this.
  2. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Did you have any luck with this? Looking to implement a similar solution but couldn't find a way to successfully filter