mardi 29 octobre 2019

having problems when using PCLVisualizer to display polygons

I'd like to use addpolygon() to show planar patches extracted from point clouds. A certain polygon surface can only display at a certain viewpoint, but after some rotation it will disappear. I also tried to use addplane() and got the same result.

pcl::visualization::PCLVisualizer pViewer("planes");

pViewer.addCoordinateSystem (1.0);

Eigen::Vector4f planarCoeff(p.plane.normal()(0), p.plane.normal()(1), p.plane.normal()(2), p.plane.offset());

pcl::PlanarPolygonpcl::PointXYZ planeHull(hull.points, planarCoeff);

std::string planeName = "polygon";

pViewer.addPolygonpcl::PointXYZ(hull.makeShared(), dist(rd)%255, dist(rd)%255, dist(rd)%255, planeName);

pViewer.setShapeRenderingProperties(pcl::visualization::PCL_VISUALIZER_REPRESENTATION, pcl::visualization::PCL_VISUALIZER_REPRESENTATION_SURFACE, planeName);

pViewer.setShapeRenderingProperties(pcl::visualization::PCL_VISUALIZER_OPACITY, 1.0, planeName);

Aucun commentaire:

Enregistrer un commentaire