GLUCYLINDER(3G)
π GLUCYLINDER β ok bestie, let's talk cylinders π
This is the tea on gluCylinder, from the 3G manual section (that's the GLU / OpenGL Utility library corner of the man pages, iykyk). Strap in, we're drawing a whole cylinder. π
β¨ NAME β¨
gluCylinder β draw a cylinder. That's it, that's the whole job. Iconic behavior, honestly. π¦
π§ C SPECIFICATION π§
void gluCylinder( GLUquadric* quad,
GLdouble base,
GLdouble top,
GLdouble height,
GLint slices,
GLint stacks )
Look at her. Six whole arguments. She's lowkey high maintenance but she delivers. π
πΈ PARAMETERS πΈ
quadβ the quadrics object, aka the whole vibe holder. You gotta make it first withgluNewQuadric. No object, no cylinder, periodt.baseβ the radius of the cylinder down atz = 0. This is the bottom's moment. πtopβ the radius of the cylinder up atz = height. The glow-up at the top, fr.heightβ how tall she is. Self-explanatory bestie, we love a straightforward parameter.slicesβ how many subdivisions go around the z axis. Think of it like the number of vertical pizza cuts going around. More slices = smoother, but more work. βstacksβ how many subdivisions go along the z axis. That's the vertical stacking, like pancakes. π₯
π DESCRIPTION π
gluCylinder draws a cylinder that's oriented along the z axis. The base of the cylinder sits at z = 0, and the top sits at z=height. And just like a sphere, the cylinder gets subdivided around the z axis into slices, and along the z axis into stacks. Same energy as gluSphere, different shape.
π Okay so important note: if you settopto0.0, this routine does NOT give you a cylinder anymore β it generates a cone. That's not a bug, that's just math being math. Set your radius to zero, get a pointy situation. Adjust expectations accordingly, bestie.
Now, about normals β the way your lighting looks depends on this:
- If the orientation is set to
GLU_OUTSIDE(you do that withgluQuadricOrientation), then any generated normals point away from the z axis. Outward vibes. π - Otherwise, they point toward the z axis. Inward vibes.
And if texturing is turned on (that's gluQuadricTexture doing the lord's work), then texture coordinates get generated like this, and I need you to pay attention because there are numbers:
tranges linearly from0.0atz = 0to1.0atz = height. Bottom to top, a clean little gradient.sranges from0.0at the+yaxis, to0.25at the+xaxis, to0.5at the-yaxis, to0.75at the-xaxis, and back to1.0at the+yaxis. Full lap around the cylinder, quarter turns at each axis. π
π«Ά SEE ALSO π«Ά
Go read these next, they're all part of the same quadrics friend group:
gluDisk(3G)gluNewQuadric(3G)gluPartialDisk(3G)gluQuadricTexture(3G)gluSphere(3G)
And that's the whole page, bestie!! π This was GLUCYLINDER(3G) β yes, the same name as the title, they really said "consistency" β straight out of the 3G manual, brought to you by the OpenGL-adjacent powers that be. Go forth and draw something tubular (literally, it's a cylinder). Slay. π
β¨π
π¦ where this page comes from
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- fedora 43: gl-manpages 1.1-34.20190306.fc43 Β· Apache-2.0 AND HPND AND HPND-sell-variant AND MIT AND OpenPBS-2.3 AND SGI-B-2.0 AND W3C-19980720 AND X11
- fedora 44: gl-manpages 1.1-35.20190306.fc44 Β· Apache-2.0 AND HPND AND HPND-sell-variant AND MIT AND OpenPBS-2.3 AND SGI-B-2.0 AND W3C-19980720 AND X11
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms