1

I am trying to extract the 3d coordinates of vertices from a mesh object using VCG library. Does anyone know how to do this? I have tried a whole evening and got nothing. It seems that the Capital letters represent some attributes of the vertex but I couldn't find a table for that. Can anyone help me out? Thank you!

user1200781
  • 111
  • 1
  • 5

1 Answers1

2

the answer is probably too late for your purpose. But perhaps the answer helps other people.

You can access the vertices in the following way:

MyMesh m;
m.clear();
// cloud->points[i] is how I store the points in a PCL point cloud format
for(int i=0; i<m.VN(); i++)
{
    cloud->points[i].x = m.vert[i].P()[0]; 
    // so m.vert[i].P()[0] is how to access the x coordinate of the i-th vertex.
    cloud->points[i].y = m.vert[i].P()[1];
    cloud->points[i].z = m.vert[i].P()[2];
}
Deepfreeze
  • 1,755
  • 1
  • 13
  • 18