2012-10-24 30 views
1

我想使用VCG庫從網格對象中提取頂點的三維座標。有誰知道如何做到這一點?我已經嘗試了整整一個晚上,什麼都沒有。似乎大寫字母表示頂點的某些屬性,但我找不到表格。誰能幫我嗎?謝謝!如何在vcg庫中提取頂點座標

回答

2

答案可能爲時已晚。但也許答案可以幫助其他人。

,您可以訪問頂點方式如下:

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]; 
}