Results 1 to 6 of 6

Thread: Drawing a cylinder

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2001
    Location
    PA
    Posts
    2

    Drawing a cylinder

    I have used the gluCylinder function, but was wondering if there was source code available somewhere that draws a cylinder in OpenGL using the OpenGL primatives. Any suggestions would be appreciated, thanks!

  2. #2
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Nov 2010
    Posts
    2,466

    Re: Drawing a cylinder

    draw a 2d circle eg with sin+cos + just give it some height

  3. #3
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,595

    Re: Drawing a cylinder

    Download Mesa
    http://sourceforge.net/projects/mesa3d/

    All the source code is included, so you can have a look at all the source code including gluCylinder.

    Mikael

  4. #4

    Re: Drawing a cylinder

    I think what I would do is first decide how many sides you want it to have, 6 sides 8, 10,100? Then draw 2 flat polygons with that many sides, those will be the top and bottom (for a solid cylinder). Next draw quads from each top vertex to its corresponding bottom vertex. Continue all around and there is your cylinder.

    Not sure if this would work let us know how it goes.

    [This message has been edited by element (edited 07-27-2001).]

  5. #5
    Junior Member Newbie
    Join Date
    Jul 2001
    Location
    PA
    Posts
    2

    Re: Drawing a cylinder

    Thanks everyone! I got it...appreciate the help!

  6. #6
    Senior Member Regular Contributor
    Join Date
    Nov 2000
    Location
    Sydney, NSW, Australia
    Posts
    426

    Re: Drawing a cylinder

    maybe instead of glutCylinder try the glu version... Quadrics....
    :: Sleep is a poor substitute for caffeine ::

Similar Threads

  1. help drawing two cylinder
    By p4ever in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 08-23-2014, 04:12 AM
  2. drawing cone and cylinder
    By in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 08-16-2012, 11:30 PM
  3. Perl Drawing of Cylinder
    By hidtero in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 10-05-2009, 12:09 AM
  4. Drawing a solid cylinder
    By wmspringer in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 04-28-2004, 08:08 AM
  5. Drawing a cylinder in opengl
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-21-2000, 12:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean