Exemple #1
0
void  viewerOneOff(pcl::visualization::PCLVisualizer& viewer)
{
    viewer.setBackgroundColor (0.3, 0.3, 0.3);
    viewer.addCoordinateSystem(1.0, 0);
    viewer.initCameraParameters();
    viewer.camera_.pos[2] = 30;
	viewer.updateCamera();
}
void
initVisualizer (pcl::visualization::PCLVisualizer &viewer)
{
  // Setting the initial viewer parameters
  viewer.initCameraParameters ();
  viewer.setBackgroundColor (0, 0, 0);
  viewer.addCoordinateSystem (1000);
  viewer.camera_.view[0] = 0;
  viewer.camera_.view[1] = 0;
  viewer.camera_.view[2] = 1;
  viewer.camera_.pos[0] = 8000;
  viewer.camera_.pos[1] = 20000;
  viewer.camera_.pos[2] = 2500;
  viewer.updateCamera ();
  viewer.addText ("Shift + click to select noisy objects. \nPress 0 to confirm the removal.", 50, 300, "user");
}
void
setViewerPose (pcl::visualization::PCLVisualizer& viewer, const Eigen::Affine3f& viewer_pose)
{
    Eigen::Vector3f pos_vector = viewer_pose * Eigen::Vector3f (0, 0, 0);
    Eigen::Vector3f look_at_vector = viewer_pose.rotation () * Eigen::Vector3f (0, 0, 1) + pos_vector;
    Eigen::Vector3f up_vector = viewer_pose.rotation () * Eigen::Vector3f (0, -1, 0);
    viewer.camera_.pos[0] = pos_vector[0];
    viewer.camera_.pos[1] = pos_vector[1];
    viewer.camera_.pos[2] = pos_vector[2];
    viewer.camera_.focal[0] = look_at_vector[0];
    viewer.camera_.focal[1] = look_at_vector[1];
    viewer.camera_.focal[2] = look_at_vector[2];
    viewer.camera_.view[0] = up_vector[0];
    viewer.camera_.view[1] = up_vector[1];
    viewer.camera_.view[2] = up_vector[2];
    viewer.updateCamera ();
}