title: Drawing a Cone and Cylinder using GLUT
body: <p>I've been trying to draw a cone and a cylinder using GLUT. The code I've written so far takes two points from the user, which represents the height of the cone/cylinder, and I want to draw a cone and a cylinder using the two points.</p>
  
  <p>I looked up Google and found standard functions called <code>glutWireCone()</code> and <code>gluCylinder()</code>, but I'm unable to understand how to use these functions to draw in the manner that I want to draw. Can someone tell me how to draw a cone and a cylinder using the two points? Please let me know if you need some extra information to understand my question correctly.</p>
  
  <p>Here are my <code>init()</code> and <code>main()</code> functions for you to know the settings of my program:</p>
  
  <pre><code>void init(void)
  {
     glClearColor(0.0, 0.0, 0.0, 0.0);
     glMatrixMode(GL_PROJECTION);
     glLoadIdentity();
     glOrtho(0.0, WINDOW_WIDTH-1, WINDOW_HEIGHT-1, 0, -1000.0, 1000.0);
     glMatrixMode(GL_MODELVIEW);
     glClear(GL_COLOR_BUFFER_BIT);
  }
  
  
  
  int main(int argc, char** argv)
  {
    glutInit(&amp;argc, argv);
    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
    glutInitWindowSize(WINDOW_WIDTH, WINDOW_HEIGHT);
    glutInitWindowPosition(220, 80);
    glutCreateWindow("Mini Paint - 3D");
  
    init();
  
    glutDisplayFunc(display);
    glutMouseFunc(mouseClick);
    glutMotionFunc(mouseMove);
    glutKeyboardFunc(keyboard);
  
    glutMainLoop();
  
    return 0;
  }
  </code></pre>