I’ve just encountered a problem in mapping texture.
I use glutSolidTorus to draw a solid torus. I successfully mapping texture to the torus. However, when I rotate it about x,y,z axis, it seems that the texture doesn’t move with the torus.
My code is as follows:
gluQuadricTexture(quadric, true);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glBindTexture(GL_TEXTURE_2D, text);
glutSolidTorus(r * 0.25, r, 61, 37);
How can I fix this problem?