Triangle Strips

Started by
1 comment, last by SoD 22 years, 6 months ago
It''s possible to render a grid of a terrain with a single call of glBegin(GL_TRIANGLE_STRIP)? the easier way is to render a strip for each row of the map in a way like this: for(z=0;z<MAP_HEIGHT;z++) { glBegin(GL_TRIANGLE_STRIP); for(x=0;x<MAP_WIDTH;x++) { glVertex3f(x,heightmap[x][z],z); glVertex3f(x,heightmap[x][z+1],z); } glEnd(); } But it''s possible to call only one glBegin? if yes, there''s some "extra" triangles? it''s an optimization useful or not? can anyone explain me how it works? thanks
Here we go!
Advertisement
My sense of logic dictates that it would be impossible, though I could be wrong...
It should be possible, but you''d have to use degenerate triangles (i.e. triangles with zero area), and I don''t know whether you would gain anything, you could try though.

I seem to remember reading that it is not recommended to use degenerate triangles to render as many triangles as possible in a strip, and that it would be better to split it into two render-calls. (I think I read it somewhere on nvidia''s site.)

This topic is closed to new replies.

Advertisement