Archived

This topic is now archived and is closed to further replies.

Tri-Strips Texture Coordinate PROBLEM!!!

This topic is 5584 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! That''s my first time so...don''t hurt me I''m working on a 3DS Max 4 Exporter plug-in and after coding ... well, debuging a way to build triangle strips, a PROBLEM came across: ¿How do I get Texture Coordinates correctly to match triangle strips? Little explanation (Taken from an exported cube with "Box - UVWMapping"): - Suppose that my resulting strip is: 4 5 7 1 3 0 2 ... - When you send those vertex indices to OpenGL with "glBegin(GL_TRIANGLE_STRIP)", it builds: face 4 5 7 face 5 7 1 face 7 1 3 face 1 3 0 face 3 0 2 .... . . . - Suppose that texture indices to this faces are: face 4 5 7 - 14 15 16 face 5 7 1 - 5 23 1 face 7 1 3 - 22 20 21 face 1 3 0 - 12 11 13 face 3 0 2 - 10 8 9 .... . . . - . . . - So, ie: vertex 7 has 3 different texture indices {16, 23, 22} while in my strip structure it''s only called once... I hope to make me understood, with my 2 most powerful weapons: my poor kindergarten english and my privileged crashed apple like IQ I know that Quake2 model files have tri-strip info, but I don''t understand the way it works to get texture coords. It saves again the UV coords? Any volunteers? And the question is: ¿ How can I assign those different texture coordinates to the same vertex (with OpenGL) ? Any brighter (happy face, happy face) idea... Thanks!

Share this post


Link to post
Share on other sites
Quake 2 model uses a sort of ''compiled rendering''that''s to say a mesh is optimized to be rendered using triangle strips and fans,
when a vertex joining a side of a triangle in the case of a strip or an origin of a triangle fan is duplicated along its own texture coordinates, so there are 2 ways to overcome this probelm using the immediate mode where each vertex has its own texture coordinates, but this increases by a 3 magnitude the number of vertices to be rendered for each triangle, or writing a stripping library ( or use an already done like nvida or stripe )
but also you may want to use compiled vertex arrays.
the explanation of a stripping function is long,very long to post here. if you want contact me and request the code


Share this post


Link to post
Share on other sites
if the verts are the same but the texture coordinates arent
unfortunately u need to make multiple vertices (even though theyre the same vertex)

http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites