Search Unity

Question In what space are the transforms we get for the MeshFilters we get from ARMeshManager?

Discussion in 'AR' started by boruds, May 21, 2021.

  1. boruds

    boruds

    Joined:
    Aug 7, 2020
    Posts:
    28
    I am trying to send the scanned ARMeshObjects from Unity to my native iOS plugin. I needed some help understanding what the vertex positions mean.

    I am subscribing to the ARMeshManager.subsystem.meshesChanged event where I get lists of added, removed and updated meshes. These objects are mesh filters.
    I am interested in getting the vertex from the meshes, but I don't understand what coordinate space this data is in for each mesh.
    Also each mesh filter has a transform associated with it, on printing the the local to world and world to local transform matrices, they both are identity.
    Are these vertices same as we get from ARKit like from the ARMeshAnchors.geometry or are they modified for unity? In ARKit, negative z axis is front of the camera and in Unity it is inverted. so does ARFoundation inverts the z-axis for the vertex data or does it transform the mesh vertices in some way. Any documentation will be helpful.

    My goal is to send this data to my native iOS plugin so I can process it, I tried accessing the ARMeshAnchors direction from the ARFrame object but the MeshAnchors have corrupted data. So I want to take the data from unity and send it to my plugin.
    Thanks
     
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
    Insight from the team:


    The mesh vertices are in the AR session coordinate space.
     
    KyryloKuzyk likes this.