View Full Version : Texture Mapping

05-07-2001, 02:45 AM
Does anyone know if you can texture map a cylinder (using gluCylinder, not creating your own from quads). If so, do you do it the same way you would to a cube? Thanks.

05-07-2001, 05:10 AM
Either use OpenGL's automatic texture coordinate generation (glTexGen*), or enable texture coordinate generation through glu when drawing your quadric. Don't know how to do that though, but you can do a search on the net.

05-07-2001, 06:13 AM
GLUquadricObj* pCylinder = gluNewQuadric();

// if you use lighting add
gluQuadricNormals(pCylinder, GLU_SMOOTH);

// For texcoords
gluQuadricTexture(pCylinder, GL_TRUE);

// Replace ... with your cylinder parameters
gluCylinder(pCylinder, ...);