PCLVisualizer labelling axes

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

PCLVisualizer labelling axes

genio777
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: PCLVisualizer labelling axes

VictorLamoine
Administrator
Hello,

#include <iostream>
#include <pcl/point_types.h>
#include <pcl/visualization/pcl_visualizer.h>

typedef pcl::PointXYZRGBA PointT;

int
main (int,
      char** argv)
{
  pcl::visualization::PCLVisualizer viewer ("3D Viewer");
  viewer.addCoordinateSystem ();
  PointT point;

  point.getArray3fMap () << 1, 0, 0;
  viewer.addText3D ("x", point, 0.2, 1, 0, 0, "x_");

  point.getArray3fMap () << 0, 1, 0;
  viewer.addText3D ("y", point, 0.2, 0, 1, 0, "y_");

  point.getArray3fMap () << 0, 0, 1;
  viewer.addText3D ("z ", point, 0.2, 0, 1, 1, "z_");

  viewer.resetCamera ();
  while (!viewer.wasStopped ())
  {
    viewer.spinOnce ();
  }
  return (0);
}
I don't know why Z doesn't show up. You got the idea!

Bye
Reply | Threaded
Open this post in threaded view
|

Re: PCLVisualizer labelling axes

genio777
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: PCLVisualizer labelling axes

MHamad
This post was updated on .
In reply to this post by VictorLamoine
You had a typo that's why its not showing.

  viewer.addText3D ("z ", point, 0.2, 0, 1, 1, "z_"); should be
viewer.addText3D ("z ", point, 0.2, 0, 0, 1, "z_");.

Also if you scaled the coordinate system you should also scale the text as
well.



--
Sent from: http://www.pcl-users.org/
_______________________________________________
PCL-users@pointclouds.org / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users