Texturing non-primitive objects...

Maybe you can help me. I know how to texture a cube, a single rectangle, etc. but I dont have any idea on how to texture, an sphere or an irregular body (e.g. a face). I read the red book but didnt find any information about this. I think I hav to set texture coordinates but dont know how to do that with irregular objects…Thx!

hi !! take a look for quadrics objects

As far as quadrics are concerned (spheres, cylinders, disks, etc …), you just have to enable automatic texture coordinates generation with :

     gluQuadricTexture(..,GL_TRUE);

before calling gluSphere(…), gluCylinder(…),…

RCMaster

But quadrics are limited to simple shapes. Otherwise you have to calculate the texture/poly vertex coords yourself. Or model it in 3d max/softimage/maya or something similar which can export the polygin and teture coords for you