PDA

View Full Version : Texture Coordinate Generation



Tokage
01-25-2003, 01:52 PM
I have a smiley-face texture that I want to map onto a sphere. Is there a way to make the texture map only appear once on the surface of a sphere instead of tiling across its surface several times? Thanks in advance for the help...

EDIT: I just realized after further experimentation that sphere-mapping the texture kind of works, but of course it distorts it and can't be the final solution...

[This message has been edited by Tokage (edited 01-25-2003).]

Deiussum
01-27-2003, 06:12 AM
Don't use texcoords outside of the 0-1 range, and set the glTexParameter GL_TEXTURE_WRAP_S and GL_TEXTURE_WRAP_T to GL_CLAMP and you should get no tiling.

ioquan
01-27-2003, 12:55 PM
There are two basic types of sphere geometry. One is like a football (soccer), with hexagonal grids made up of smaller triangles. The other is like the latitude and longitude lines on the globe. You will get different texture results depending on how your sphere's geometry is made up. Experiment with the two different types of geometry to get the results you want.