Putting on textures on a WireSphere

I’m trying to apply a texture to a glutWireSphere. Can anyone tell me how to do this? All the stuff i’ve seen uses Quads. I am loading the texture from a BMP file

only glutSolidTeapot & glutWire Teapot have texturing co-ords. You’d have to get openGl to generate the texturing co-ords for you.

I might post a stupid question but how can you texture a wired object ?

I thought only solid objects could be textured ???

jc:
Nop, If you want you can also texture wired object provided you have texture coordinates.
You can texture lines with 1D or 2D textures.

Originally posted by garbash:
I’m trying to apply a texture to a glutWireSphere. Can anyone tell me how to do this? All the stuff i’ve seen uses Quads. I am loading the texture from a BMP file

If you use the gluQuadricxxx commands, you can create a sphere, auto-generate the texcoords and normals and flip between solid and wireframe mode quite easily with a call to glPolygonMode.

Otherwise using glut you’ll have to generate the coords yourself.

liB

GLUquadricObj* quadric = gluNewQuadric();

// ...

gluQuadricDrawStyle(quadric,GLU_FILL);
gluQuadricTexture(quadric,GL_TRUE);
glBindTexture(GL_TEXTURE_2D,m_Texture.index());
gluSphere(quadric,0.50f,m_NumSlices,m_NumStacks);

// ...

gluDeleteQuadric(quadric);