2014-01-06 45 views
2

我將使用PCL 1.6可視化由GreedyProjectionTriangulation產生的網格。使用PCLVisualizer對網格進行可視化PCL 1.6

我發現我不得不使用

pcl::visualization::PCLVisualizer.addPolygonMesh() 

但我的問題是如何利用PCLVisualizer而不是

pcl::visualization::CloudViewer 

也得到流。

我嘗試這樣做:

http://www.pcl-users.org/Simple-Kinect-viewer-that-writes-a-PCD-tp3883792p3940787.html

,並建議解決

http://www.pcl-users.org/Simple-Kinect-viewer-that-writes-a-PCD-tp3883792p3954525.html

,它是將參數的功能openNIGrabber。 無論如何,編譯器是好的,但是當我運行它中止。我正在使用VS2010 64位

有人可以建議我另一種解決方案嗎?

+0

有人能幫助我嗎?我想要顯示網格 – SPS

回答

3

這個工作在PCL 1.8和PCL 1.7.2:

pcl::PolygonMesh mesh; 
pcl::io::loadPolygonFileOBJ("table.obj",mesh); 

boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer (new pcl::visualization::PCLVisualizer ("3D Viewer")); 
viewer->setBackgroundColor (0, 0, 0); 
viewer->addPolygonMesh(mesh,"meshes",0); 
viewer->addCoordinateSystem (1.0); 
viewer->initCameraParameters(); 
while (!viewer->wasStopped()){ 
    viewer->spinOnce (100); 
    boost::this_thread::sleep (boost::posix_time::microseconds (100000)); 
}