problem with texture

Haw can I put texture on gluCylinder. I want to put some small texture on one Cylinder.
void studnia(){

//studnia

glTranslatef(10,0,10);

GLUquadricObj* studnia;	// pow. wody
glEnable(GL_TEXTURE_2D);

glBindTexture(GL_TEXTURE_2D, texture[1]);
glColor3f(1.0f,1.0f,1.0f);
glRotatef(-90,1,0,0);

studnia = gluNewQuadric();
gluQuadricTexture(studnia, GL_TRUE);
gluCylinder(studnia,4.0, 4.0, 3, 15, 15);

glRotatef(90,1,0,0);

I guess that you should allow GLU to calculate normals for you :

gluQuadricNormals(quadratic, GLU_SMOOTH);

Anyway, you shouldn’t put this :

studnia = gluNewQuadric();

inside the main loop. The quadric object needs to be created only once. You might want to declare ‘studnia’ as a global variable.

Pozdrawiam :wink:

When I was brushing my teeth in the morning and I was thinking what I have done yesterday, I realized that smooth normals don’t have much to do with texture binding. Anyway, it’s worth a try. :wink: