# triangle strips.

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

## Recommended Posts

I cant seem to figure out howto draw more than one unrelated tstrip with one drawprimitives call. Do I have to use a loop and make multiple calls? Or should I use DIP, if so how does it work with triangle strips. Currently I just fill a vertex buffer up with my triangle strip I need to draw and call draw primitives but I get garbage because it attempts to connect unrelated strips.

##### Share on other sites
When you render a buffer isa Triangle Strip I'm pretty sure it has to be a single strip. When you want to connect multiple strips to make one you use something called "degenerate triangles", or triangles that have no area. I'm pretty sure the simplest way of doing this is ending a strip by creating one last triangle where 2 vertices are the same, then sendeing it the first vertex of the next list twice, and then going from there.

##### Share on other sites
A triangle strip with always link together all the triangles in it. You'll need to either make multiple calls to DrawPrimitive or use triangle lists.

Edit : If you did try to do it by stacking verts in the same location you might get away with it but more than likely you'll still end up with a line connecting the 2. Not something I've ever tried,

##### Share on other sites
well, the IDirect3DDevice9->DrawPriimitive() has 3 parameters and I will explain them for you:

1º)D3DPRIMITIVETYPE: the type of primitive you wanna draw(D3DPT_TRIANGLESTRIP, D3DPT_TRIANGLELIST, ....);
2º)StartVertex: The index of the vertex you'll begin to draw.
3º)PrimitiveCount: number of primitives(triangles) you'll draw.

Lets supose you have defined 6 vertices.Using traingles strips you'll normally want to draw 4 triangles.But if you want to draw 2 triangles(the first and the last), you'll need to do two calls to DrawPrimitive:

d3dDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 1);
d3dDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, 3, 1);

I hope I've helped you!....cya

##### Share on other sites
Aha thanks guys you made me realise what I need to do.

##### Share on other sites
Quote:
 Original post by KafeenEdit : If you did try to do it by stacking verts in the same location you might get away with it but more than likely you'll still end up with a line connecting the 2. Not something I've ever tried,

Nope, no line. Its pretty much standard practice when stripifying anything that can't be just one strip, like most height map based terrain. Lets you a lot less calls to DrawPrimitive which is always good) and keep the memory bandwidth saving attributes of TriangleStrips.

1. 1
Rutin
37
2. 2
3. 3
4. 4
5. 5

• 11
• 15
• 12
• 14
• 9
• ### Forum Statistics

• Total Topics
633352
• Total Posts
3011483
• ### Who's Online (See full list)

There are no registered users currently online

×