PDA

View Full Version : Putting on textures on a WireSphere



garbash
11-14-2000, 06:49 AM
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

Rob The Bloke
11-15-2000, 11:11 PM
only glutSolidTeapot & glutWire Teapot have texturing co-ords. You'd have to get openGl to generate the texturing co-ords for you.

jc
11-15-2000, 11:31 PM
I might post a stupid question but how can you texture a wired object ?

I thought only solid objects could be textured ?????

Moz
11-16-2000, 06:28 AM
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.

bsimser
11-16-2000, 10:39 AM
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

pleopard
11-20-2000, 02:36 PM
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);