How to cap the gluCylinder() ends

This is a discussion on How to cap the gluCylinder() ends within the Game Programming forums, part of the General Programming Boards category; i am drawing a gluCylinder but it appears to be hollow tubes. I want the two end to be capped, ...

  1. #1
    Registered User
    Join Date
    Mar 2008
    Location
    vancouver bc
    Posts
    28

    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.

    Code:
      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
    Posts
    9,584
    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 Cprogramming.com
    Replies: 17
    Last Post: 02-08-2005, 02:26 PM
  5. Some loose ends
    By pdstatha in forum C Programming
    Replies: 7
    Last Post: 03-31-2002, 03:03 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21