PDA

View Full Version : gluSphere and textures



ndtp
04-25-2002, 10:07 AM
I have a texture mapped onto a gluSphere. I've noticed that the texture is blurry and seems stretched. When I tried to do quadstrips to create the sphere, the texture was not blurry. I am doing the usual commands:

in the init:
glShadeModel(GL_FLAT);
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
obj = gluNewQuadric();
gluQuadricOrientation(obj, GLU_OUTSIDE);
gluQuadricDrawStyle(obj, GLU_FILL);
gluQuadricTexture(obj, GL_TRUE);

in the draw:
glEnable(GL_TEXTURE_2D);
glColor3f(1.0, 1.0, 1.0);
gluSphere(obj, radius, 24, 24);
glDisable(GL_TEXTURE_2D);

When I loaded the texture I set the following:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);

Is there something obviously wrong here? Should I just try to get the quad strips working?

Thanks for your help.