Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Edit or remove points from ARPointCloud

Discussion in 'AR' started by GoldARVR, May 6, 2020.

  1. GoldARVR

    GoldARVR

    Joined:
    Oct 28, 2019
    Posts:
    6
    Hi, I would like to remove multiple points from the ARPointCloud.

    I am using ARFoundation 4.0.0-preview, ARKit 3.0 on a iPhone 8, with Unity 2019.3.5 .

    When I capture the environnment in front of my phone, it create a point cloud with multiple points. But sometimes, it creates points in the air in front of my phone's camera, which are totally wrong, and do not represent a surface at all.

    I would like to delete these misplaced points (automatically or manually with the user of my app).

    Is is possible to do, if so, how ?

    I searched the API, in the class ARPointCloud in ARFoundation :
    Code (CSharp):
    1. public NativeSlice<Vector3>? positions { get; }
    There is no
    { set; }
    accessor, so I can't modify the point cloud with the ARPointCloud class.

    But in the XRPointCloudData in XRSubsystems :
    Code (CSharp):
    1. public NativeArray<Vector3> positions { get; set; }
    There is the
    { set; }
    accessor, but I can't find a way to access the XRPointCloudData of my point cloud.
     
  2. GoldARVR

    GoldARVR

    Joined:
    Oct 28, 2019
    Posts:
    6
  3. todds_unity

    todds_unity

    Unity Technologies

    Joined:
    Aug 1, 2018
    Posts:
    324
    The ARPointCloud data is read-only data coming from the device.
     
    OlliQueck likes this.
  4. OlliQueck

    OlliQueck

    Joined:
    Apr 11, 2013
    Posts:
    49
    is there a way to reset it? other than ARSession.Reset() ? After a couple of minutes in my scene the point cloud gets huge and hard to handle. I would need a constant flush so I either only have points of a specific "age" like 10 seconds or something. Or just reset it every 10 seconds so I get a new bunch of points