PDA

View Full Version : Single texture on multiple triangle strips



karbuckle
05-03-2004, 02:21 PM
I'm just starting to get my feet wet with texture mapping and wanted to find out if it is possible to map a single texture across multiple triangle strips.

Thanks in advance for your help.

plasmonster
05-03-2004, 03:52 PM
I'm just starting to get my feet wet with texture mapping and wanted to find out if it is possible to map a single texture across multiple triangle strips.
karbuckle,

there sure is. It all depends on the kind of mapping you want. For a 2D mapping, you would need to determine a good plane to project the triangles on to, one that best fits the overall orientation of the triangles, then pick the s and t axes to lie in this plane. A typical way to do this is to pick a world axis that best matches the average triangle normal, then use the other 2 world axis as the s and t vectors.

There are many other mapping as well. You could use a cylinder, sphere, cube, and so on.

The idea is to pick a single geometry to project all the triangle into, so they are all in the same texture space.

Aeluned
05-03-2004, 03:54 PM
Yes, it's certainly possible. You bind the texture first and then draw all of your triangle strips. You're going to find that you probably need to generate your own texture coordinates however so that it 'fits' right.

karbuckle
05-05-2004, 03:16 PM
Thanks for your helpful replies! I've got a better picture of what I need to do now.