Thread: How to cap the gluCylinder() ends

  1. #1
    Registered User
    Join Date
    Mar 2008
    vancouver bc

    How to cap the gluCylinder() ends

    i am drawing a gluCylinder but it appears to be hollow tubes. I want the two end to be capped, or completely filled.

      GLUquadricObj *p = gluNewQuadric();
      gluCylinder(p, 0.5, 0.5, 2, 20, 2);
    Someone said that if i make the stack parameter to '2' the two ends are capped. i tried it (as typed in the code box) still no caps. Is there a way to make gluCylinder close two ends without declaring two other gluDisc?

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    No idea. However capping it is as simple as drawing a triangle fan with the same number of segments as the tube. Draw the triangle fan at the both ends of the tube. The origin for the triangle fan should be on the centerline of the tube.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program ends unexpectedly
    By keelhauled in forum C Programming
    Replies: 3
    Last Post: 10-12-2007, 05:41 PM
  2. instance of a class disappearing after function ends
    By combatdave in forum C++ Programming
    Replies: 14
    Last Post: 10-20-2006, 08:59 AM
  3. Socket abruptly closes after function ends
    By Sfpiano in forum Networking/Device Communication
    Replies: 1
    Last Post: 08-08-2005, 04:49 PM
  4. LinuxQuestions Choice Awards Ends Today!!
    By Kleid-0 in forum A Brief History of
    Replies: 17
    Last Post: 02-08-2005, 03:26 PM
  5. Some loose ends
    By pdstatha in forum C Programming
    Replies: 7
    Last Post: 03-31-2002, 04:03 PM