Search Unity

Question Only get new ARMeshManager mesh data?

Discussion in 'AR' started by metigel94, Apr 12, 2021.

  1. metigel94

    metigel94

    Joined:
    Oct 11, 2019
    Posts:
    12
    Hi all.

    Is there some way to only get mesh data (vertices and triangles) from the ARMeshManager that are truly new? Lets say I capture something using the LiDAR scanner and save the scanned data at time instance 1. Now, I continue capturing and save all the newly captured data at time instance 2. However, when looking at the data for time instance 2, it also contains all the data from time instance 1.

    Is there any way to only get the new data that has been added at time instance 2? I tried subtracting the triangles, but doing this is not yielding good results since the mesh data changes so much between frames.

    I'm aware that I could simply get the final mesh data using the meshes property of the ARMeshManager when I'm done scanning. Unfortunately, however, I need temporal information of when the mesh data was created.

    Any suggestions are highly appreciated :)
     
  2. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,144
    Unfortunately, the AR Foundation doesn't have this functionality. Scanned meshes are rebuilt from scratch with every new call to XRMeshSubsystem.GenerateMeshAsync().
     
    metigel94 likes this.
  3. metigel94

    metigel94

    Joined:
    Oct 11, 2019
    Posts:
    12
    Thanks for your reply.
    That's very unfortunate for my use-case.
     
  4. IR_Andrew

    IR_Andrew

    Joined:
    Jun 4, 2021
    Posts:
    5
    Hi there how did you manage to get the data from the ARMeshManager and save it to a .fbx or .obj file? I know there are some parameters that cater for color, etc but do you mind sharing the code for that. I tried FBX exporter yet no luck, I tried assetDatabase but I'm not winning that side either :(