Hi

I am having a few problems creating an index buffer for a triangle strip for a terrain section.

I have a section similar to the following.

0 - 1 - 2 | / | / | 3 - 4 - 5 | / | / | 6 - 7 - 8

I define my triangle strip using the following indices also with one degenerate triangle, I have bolded it so it stands out better.

0, 3, 1, 4, 2, 5, **5, 3**, 3, 6, 4, 7, 5, 8

My first question is, is this degenerate correct it seems to be correct, but my next problem is what confuses matters as it really affects wether my terrain tile renders correctly without gaps.

When it comes round to making my DrawIndexedPrimitives call, I have to specify the number of vertices, and the total number of primitives.

I would have thought the number of vertices will be the total count of indices (indices.length) and I would have thought that the total number of primitives would be:

(number of quads * 2) + rows - 1

where rows - 1 would define the number of degenerate triangles.

Something is terribly going wrong with this, if because it renders the strips with gaps inbetween them, its only when I bump up the number of primitives to some wrong value (but more triangles than there is) then it displays the terrain correctly without gaps.

Can anyone help me here and tell me what I might be doing wrong, or help me calculate the correct number of primitives for a DrawIndexedPrimitives call using a triangle strip.

This is probably a simple thing to a 3d guru but I am unfortunately not that :(