title: How can Visualize 3D points on C++
body: <p>I am developing a 3D reconstruction project using Opencv and PCL. In my code a voxel is represented by cv::Point3f coordinates</p>
  
  <p><strong>Voxel.hpp</strong></p>
  
  <pre><code>    class Voxel
      {
      private:
  //3D Coordinates of voxel
          cv::Point3f coordinates;
      public:
  //constructor of voxel
          Voxel(float x, float y, float z);
          void drawVoxel();
      };
  </code></pre>
  
  <p><strong>Voxel.cpp</strong></p>
  
  <pre><code>//implement constructor
  Voxel::Voxel(float x, float y,float z)
  {
      coordinates.x=x;
      coordinates.y=y;
      coordinates.z=z;
  
  }
  //draw one voxel (3D point).
  void Voxel::drawVoxel()
   {
          pcl::PointXYZ pt;
          pt.x=coordinates.x;
          pt.y=coordinates.y;
          pt.z=coordinates.z;
          pcl::visualization::CloudViewer viewer ("draw voxel");
          viewer.showCloud (pt);
  
      }
  </code></pre>
  
  <p>I get an error in the last line in drawVoxel() function. How can i fix that?</p>