PDA

View Full Version : Texturing Objects build from Triangles



XBCT
03-03-2000, 09:05 AM
I know how to put a Tga or pcx as Texture on
-for example- a Quad with glTexImage2f.
But how do I map these Texture on a Object
-for example- a sphere,which consist of Triangles(Faces),if I want the bitmap to cover the whole sphere and not only a single face?

Eric
03-05-2000, 10:27 PM
Hi !

I am not sure you will like the answer but you have to calculate the textures coords yourself....

Basically, most of us use a modelling tool (for me it's 3DS Max r3) which generates those mapping coords. Then, we import the object along with its normals (calculated in the software as well) and texture coords.

You might find links on the web for algorithm about texture coords generation. But I can't remember those links !

You can also ask OpenGL to generate those coords (look at glTexGen function) but this won't work for complicated objects...

Hope this helps !

Eric

XBCT
03-06-2000, 04:28 AM
I know read ASE-Files(exportet by 3Dsmax) and
the Texture coordinates from this Files work
perfect.Muchos Gratias Eric!