Advertisement

Triangle strips

Started by November 03, 2003 07:31 PM
2 comments, last by Benbe 21 years, 4 months ago
Is it possible to end a triangle strip without calling glEnd()? Batching would be impossible without it, so there must be a way like sending in the same vertex several times etc.. anyone have any ideas?
I''ve found an article by Tomas Möller (author of Real Time Rendering) that says the trick is to make degenerate triangles instead of making new api calls. Let''s say for example that I want to draw two triangles at different locations defined by vertex indicies (excuse my spelling):
0,1,2 and 3,4,5

I should send vertecies 0,1,2- 2,3,- 3,4,5. The 2 and 3 in the middle are supposed to make a degenerate triangle which will have zero area and won''t end up in the framebuffer.

But this doesn''t work for me in my program, somehow my degenerate vertecies are ignored which creates a completely different result than I would expect.

Is there something OpenGL specific that I should know about?

Thanks for your time

/Benbe
Advertisement
Never mind, it was just me writing buggy code.
Since I''m on the topic:

Will it benefit me to provide different routines for drawing strips and fans in my engine framework or will that just cause unneccessary jumps in my vertexbuffer when I render my objects? Is it safe to always use the technique cited above?

This topic is closed to new replies.

Advertisement