non-sequential texture coords in a quad strip?

Started by
0 comments, last by redmonkey 22 years, 12 months ago
[as subject] can it be done? or do i have to specifiy 4 vertexes instead to force non-sequential texture mapping? __________________ graham "red" reeves. red@deadpenguin.org www.deadpenguin.org
__________________graham "red" reeves.[email=red@deadpenguin.org]red@deadpenguin.org[/email]www.deadpenguin.org
Advertisement

You can use a technique called triangle stitching to make a discontinuity in a triangle or quad strip, either in position, texture coords or any other vertex params. I''ll talk about triangles if you don''t mind as they''re easier to think about ( for me at least ).

What you do is: as you drawing triangles, send some extra triangles that have the points you''re trying to stich together as degenerate points, ie the same point occurs more that once in a triangle. This gives the triangle a side of zero and so it shouldn''t be drawn, which gives you an opportunity to jump to new positions or texture co-ords.

so you draw the points:


0, 1, 2
1, 2, 2
2, 2, 3
2, 3, 3
3, 3, 4
3, 4, 5


If the points 0, 1, 2, are away from 3, 4, 5 this should draw two independent triangles, inside one glBegin/glEnd loop. Or if points 1 and 2 are at the same position as points 3, 4, but with different texture coords, the effect will be a jump in texture mapping

This *should* work on most/all graphics cards, but it obviously depends on the card not drawing any part of the stitching triangle. They shouldn''t do as the length of one of the sides is zero, but I wouldn''t bet any money that some cards out there would draw some annoying glitches on the screen.

cheers
dan

ps mail me if you want a diagram of this, if my explanation don''t make sense.


Game production:
Good, quick, cheap: Choose two.
Game production:Good, quick, cheap: Choose two.

This topic is closed to new replies.

Advertisement