0

Though I know gluCylinder is somewhat old(and glu too) and glut is still there(through freeglut) but I saw those two and wondering what's the difference ? besides that gluCylinder requires that you define a Quadric, and what's faster ? .

niceman
  • 2,653
  • 29
  • 57

2 Answers2

4

The original GLUT did not have a glutSolidCylinder() function. That appears to be something FreeGLUT added.

gluCylinder

Pros:

  • Supports texture coordinate generation.

Cons:

  • GLU is old. I mean, really really old. The spec was last updated in 1998, and I suspect that the available implementations are just as old. This means that it's using immediate mode rendering (glBegin/glEnd) style, which is inefficient, and not available anymore in modern versions of OpenGL.
  • GLU support is starting to disappear from some platforms.

glutSolidCylinder

Pros:

  • As long as you're comfortable with using FreeGLUT, it's still supported, with source code available.
  • The FreeGLUT version seems to be able to use moderately modern rendering methods (VBOs), based on browsing the source code.

Cons:

  • Does not generate texture coordinates. This was definitely not supported for most solids in GLUT, and as far as I can tell is still not supported for cylinders in FreeGLUT.

self-made

Rendering a cylinder is very easy. Personally, I would just write it myself.

Reto Koradi
  • 53,228
  • 8
  • 93
  • 133
0

I agree with @Reto. I prefer implementing a cylinder myself too. Specially because it has a simple parametric form (a stack of circles). Interestingly, I was helping somebody else to dray cylinders. Maybe you find that interesting too:

Make a line thicker in 3D?

Community
  • 1
  • 1
Good Luck
  • 1,104
  • 5
  • 12