Mesh visualizing PCL 1.6 using PCLVisualizer
Asked Answered
N

1

7

I would visualize mesh resulting from GreedyProjectionTriangulation using PCL 1.6.

I found I have to use

pcl::visualization::PCLVisualizer.addPolygonMesh()

but my problem is how to use PCLVisualizer and not

pcl::visualization::CloudViewer

to get also the streaming.

I tried this:

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

and also the suggestion to solve

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

that is adding arguments to function openNIGrabber. Anyway, for the compiler is ok, but when I run it aborts. I'm using VS2010 64bit

Could someone suggest me another solution?

Nevus answered 6/1, 2014 at 20:39 Comment(1)
Could someone help me? I'd like to want to visualize meshNevus
U
9

This works in pcl 1.8 and 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));
}
Underact answered 29/9, 2014 at 2:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.