PDA

View Full Version : textures with solid shape calls



04-27-2001, 08:20 AM
Okay, I'm not using wire frames anymore. Instead, I am using glutSolidDodecahedron() to create my shape. Now I want to stick an image like a decal onto the thing.
The glut call by itself produces a hedron with white faces. I tried to do glEnable(TEXTURE_2D) to stick my greyscale image onto the hedron. What resulted was a hedron with a solid grey color applied to all sides. Do I have to use texture coordinates? If so, how? WHat am I doing wrong?

RandyU
04-28-2001, 10:56 AM
You can use auto texture coordinates:
glTExgeni(gl_S,GL_TEXTURE_GEN_MODE,GL_OBJECT_LINEA R);
glTExgeni(gl_T,GL_TEXTURE_GEN_MODE,GL_OBJECT_LINEA R);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);

But this will make shape badly-textured.

Another way is to use glTexCoord - insert them before each glVertex.