Recommended Posts

hi,
I created a texture using triangle list. I would like to texture it. I can texture the first face but I have some difficulties to texture the others
each face is built in this way
1|---|3
|\ |
| \ |
0|__\|2
triangle 0 1 2
triangle 1 2 3
so for the first face I can see my texture
for the point 0 u=0 and v=1
for the point 1 u=0 and v=0
for the point 2 u=1 and v=1
for the point 0 u=1 and v=0
but for the second face I use the points 2 and 3(of the picture above). my problem is how can I texture the second face if I already gave the coordinate texture of the points 2 and 3.
I hope that my explanations are understandable.
thank you for any help you can give!!

0

Share this post

Link to post

Share on other sites

Advertisement

Guest Anonymous Poster

Guest Anonymous Poster

You want the same texture coordinates most of the time, as you''re continuing to texture the second triangle from the same place in the texture map that you finished the first triangle. If you want to jump to a new location in the texture you must duplicate the vertex with the same position, but different UVs.

Share this post

Link to post

Share on other sites

Guest Anonymous Poster

Guest Anonymous Poster

Ah, a cube, not just a box. Sorry. I blame the face that GameDev screws up ascii art.

No, you''ll have to duplicate vertices. In some cases you might be able to get away with U going from 0 to 1, then 1 to 2, then 2 to 3 (or 0 to 0.25, 0.25 to 0.50, 0.50 to 0.75, etc). In general though vertices need to be duplicated.

The cube is one of those simple examples that isn''t so simple because of texturing, AND because of normals for lighting. Most meshes don''t suffer from this too much, but the cube, as simple as it seems, is one of the extreme cases.