Jump to content
  • Advertisement
Sign in to follow this  
chad_420

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites
Quote:
Original post by Kafeen
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,

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!