Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 9 of 9

Thread: drawing cone and cylinder

  1. #1
    Guest

    drawing cone and cylinder

    hi to all of u..

    i m doing my final project now, and i really REALLY want to know how to draw cone and cylinder using openGL..i hope all of u here can help me...

    thanks

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    654

    Re: drawing cone and cylinder

    So do you want to know how to get opengl to work or just the algorithm for cone and cylinder?

    gav

  3. #3
    Guest

    Re: drawing cone and cylinder

    yup...i want to know how get opengl to work on those cones and cylinders..

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,982

    Re: drawing cone and cylinder

    gluCylinder will do the job for you.

    Code :
    GLUquadricObj *quadObj = gluNewQuadric();
    gluCylinder(quadObj, base, top, height, slices, stacks);
    i think.
    base=base radius
    top=top radius

  5. #5
    Guest

    Re: drawing cone and cylinder

    thanks...but what about the cone?

  6. #6
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,982

    Re: drawing cone and cylinder

    Uhmm... thought you could figure that out

    A cone is a cylinder with top (or bottom if you want the cone "up side down") radius set to zero.

    [This message has been edited by Bob (edited 09-27-2000).]

  7. #7
    Junior Member Newbie
    Join Date
    Feb 2012
    Posts
    3

    Re: drawing cone and cylinder

    I would like to draw a so-called-cylinder but the base and top are not parallel. Any ideas if there is such a function or do I need to hardcode it. If so, how?

  8. #8
    Senior Member OpenGL Pro BionicBytes's Avatar
    Join Date
    Mar 2009
    Location
    UK, London
    Posts
    1,165

    Re: drawing cone and cylinder

    I would like to draw a so-called-cylinder but the base and top are not parallel
    A gluCylinder most certain is! Are you sure you have not just rotated the model with a viewing transform or something?

  9. #9
    Newbie Newbie
    Join Date
    Aug 2012
    Posts
    1
    Wrote an article describing how to draw a cone without using GLU/GLUT, would be happy to know if there are errors!

    http://www.freemancw.com/2012/06/opengl-cone-function/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •