Archived

This topic is now archived and is closed to further replies.

Combining Multiple Triangle Strips

This topic is 5000 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

Hello, Does anyone have any pointers on how to combine multiple triangle strips into one. I''m working with terrain mesh''s 16x16 in size. I would like to put them into a single vertex array rather then 16 separate arrays per mesh. Thanks, Jason

Share this post


Link to post
Share on other sites
After searching many resources (including this site) that is the method I am currently using. But since the terrain is not flat, the segment connecting the strips show if there is a dip in the terrain. I could add a vertex below mesh''s lowest point, but that does not seam to make sense for a lot of reasons.

Here is a screen shot of my issue.

I will reread all of the posts on the topic again, maybe im missing something.

Thanks,

Jason

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I don''t think you do the degenerate trianlges correctly. the point of degenerate tris are that they have zero area, and are thus not visible.

Remember that you will ned _2_ degenerate triangles to connect two strips.

Share this post


Link to post
Share on other sites
To combine two strips:

- first strip
- repeat last vertex of first strip
- repeat first vertex of second strip
- second strip

- etcetera

You can string as any strips together as you want like this. Note: You will need at least half-a-decent video card for this to work. Older cards (like the TNT2 and GeForce2 which I use a lot) are very slow at detecting and removing these degenerate triangles.


Lone Wolves Game Development
Sander Maréchal
[Lone Wolves][Game Developers Emporium][E-mail]
[Hosting $7,95/mo][Forum FAQ][Google]


[edited by - sander on April 5, 2004 10:42:39 AM]

Share this post


Link to post
Share on other sites
I''m not sure why I''m getting that bug as show in the previous screen shot. I''m doing the triangle degenerate as sander''s posts shows (thank you very much by the way.) I have come up with a new solution that should work well by using a start to end, end to start, start to end, etc approach.. This should work well but just take a little time to rework my lod system.

Thanks to everyone who gave a little info on the topic,

Jason

Share this post


Link to post
Share on other sites
From that screenshot I gather that you are not tying your strips togehter correctly. Either that or you have a really really old card that cannot kill degenerate triangles but kills duplicate vertices instead (onboard GL with old drivers?).

You can easily figure out the problem though. just ''cout'' the index buffer (or just a vertex number if you don''t use vertex buffers) to a file and examine it. You should get a long list of numbers. Any 3 numbers next to eachother make up a triangle. See if it is cirrect at the place where two strips meet. EG, you have a grid like this (showing the vertex numbers or index numbers).

0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15

That''s a 4x4 grid to be rendered in 3 strips. You should render the list as follows:

0, 4, 1, 5, 2, 6, 3, 7, 7, 4, 4, 8, 5, 9, 6, 10, 7, 11, 11, 8,8, 12, 9, 13, 10, 14, 11, 15

The extra added vertices are shown in bold. If your list does not look like this, find out why. Alternatively, you can render is snakewise like so:

0, 4, 1, 5, 2, 6, 3, 6, 7, 6, 11, 6, 10, 5, 9, 4, 9, 8, 9, 12, 9, 13, 10, 14, 11, 15



Lone Wolves Game Development
Sander Maréchal
[Lone Wolves][Game Developers Emporium][E-mail]
[Hosting $7,95/mo][Forum FAQ][Google]

Share this post


Link to post
Share on other sites