title: How to display a point cloud with openGL
body: <p>I'm trying to display a point cloud with <code>OpenGL</code>.</p>
  
  <p>I have followed some tutorials and I managed to display some geometric schema but when i try to display a point cloud read from a csv file, it does not work. 
  The reading of file work very well.</p>
  
  <p><strong>the includes</strong></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  #include &lt;cstdlib&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;boost/tokenizer.hpp&gt;
  #include &lt;sstream&gt;
  #include &lt;vector&gt;
  
  #include &lt;SDL/SDL.h&gt;
  #include &lt;GL/gl.h&gt;
  #include &lt;GL/glu.h&gt;
  #include &lt;algorithm&gt;
  
  #include "Point.cpp"
  #include "drawing.cpp"
  
  using namespace std;
  </code></pre>
  
  <p><strong>declarations</strong></p>
  
  <pre><code>void draw(vector&lt;Point&gt; v);
  
  int pointsNBR = 200;
  
  char *theFileName;
  </code></pre>
  
  <p><strong>main method</strong></p>
  
  <pre><code>int main (int argc, char** argv) {
  
    if(argv[1]){
      theFileName = argv[1];
    }else{
      cout &lt;&lt; "Please enter the file name !!\n";
      exit(0);
    }
  
    if(argv[2]){
      pointsNBR = atoi(argv[2]);
    }
    PCEngine(theFileName, pointsNBR);
  
      SDL_Init(SDL_INIT_VIDEO);
    atexit(SDL_Quit);
    SDL_WM_SetCaption("Point Cloud", NULL);
    SDL_SetVideoMode(720,640, 32, SDL_OPENGL);
  
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluPerspective(70,(double)640/480,1,1000);
  
    bool continuer = true;
    SDL_Event event;
  
    vector&lt;Point&gt; v = getCloudPoint(theFileName);
      draw(v);
  
    for (;;)    {
      SDL_WaitEvent(&amp;event);
      switch(event.type){
          case SDL_QUIT:
          exit(0);
          break;
      }
    }
  
  }
  </code></pre>
  
  <p><strong>draw method</strong></p>
  
  <pre><code>void draw(vector&lt;Point&gt; v){
  
    glPushAttrib(GL_ALL_ATTRIB_BITS);
    glPushMatrix();
  
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
  
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
  
    gluLookAt(3,4,2,0,0,0,0,0,1);
  
    glPointSize(2.0);
  
    glBegin(GL_POINTS);
      for (size_t n = 0; n &lt; v.size(); n++){
          glColor3ub(v[n].r, v[n].g, v[n].b);
          glVertex3d(v[n].x, v[n].y, v[n].z);
      }
    glEnd();
  
    glFlush();
    SDL_GL_SwapBuffers();
  
    glPopMatrix();
    glPopAttrib();
  }
  </code></pre>
  
  <p>My problem is that I haven't any display.</p>
  
  <p>Can someone help me please?</p>