JoeHull
JoeHull

Reputation: 31

Displaying a Mesh based on pointcloud data

I am sampling data from the point cloud and trying to display the selected points using a mesh renderer.

I have the data but I can't visualize it. I am using the Augmented Reality application as template.

I am doing the point saving and mesh population in a coroutine. There are no errors but I can't see any resulting mesh. I am wondering if there is a conflict with an existing mesh component from the point cloud example that I use for creating the cloud.

I pick a point on screen (touch) and use the index to find coordinates and populate a Vector3[]. The mesh receiveds the vertices( 5000 points out of 500000 in the point cloud)

this is where I set the mesh:

 if (m_updateSubPointsMesh)
 {
      int[] indices = new int[ctr];
      for (int i = 0; i < ctr; ++i)
      {
           indices[i] = i;
                            }
           m_submesh.Clear();
           m_submesh.vertices = m_subpoints;
           int vertsInMesh = m_submesh.vertexCount;

           m_submesh.SetIndices(indices, MeshTopology.Points, 0);

       }
      m_subrenderer.material.SetColor("_SpecColor", Color.yellow);

I am using Unity pro 5.3.3 and VS 2015 on windows 10.

Comments and advice are very much appreciated even if they are not themselves a solution.

Jose

Upvotes: 1

Views: 3246

Answers (2)

JoeHull
JoeHull

Reputation: 31

I sort it out. The meshing was right it turn out to be a bug on a transform (not tango-defined). The mesh was rendered in another point. Had to walk around to find it.

Thanks

Upvotes: 1

soncis
soncis

Reputation: 150

You must convert the Tango mesh data to mesh data for unity, its not structured in the same way I believe its the triangles thats different. You also need to set triangles and normals to the mesh.

Upvotes: 0

Related Questions