title: mouse movement opengl
body: <p>I am creating a pool game written in C++ using plain OpenGL (no external tools), but I can use GLUT. I have drawn a pool cue which I want to follow the mouse  cursor but I am not sure how to do this.</p>
  
  <p>I know how to use keyboard input to move things e.g camera position or draw an object but I
  m not sure how to move an object using mouse input.</p>
  
  <p>This is the cue i am trying to move via mouse input:</p>
  
  <pre><code>void cue () {
    glBegin;
    glTranslatef(-10,5,0); 
    glRotatef(90,0,1,0); 
    glutSolidCone(0.25, 15, 20, 20);
    glEnd();
  }
  </code></pre>