• Advertisement
Sign in to follow this  

NvTriStrip Problems...

This topic is 3496 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, I hope this is the right forum for this question! I'm a little confused about this whole thing so I apologise in advance for any stupidity! I want to convert geometry data structures into one single triangle strip and decided to experiment with NvTriStrip library, but i dont now how to use it. I have an list with polygon objects which consisting of 3 points (vector data)... how can i convert this into a list of indices the stripifier understands, so that i can call the GenerateStrips(const unsigned short* in_indices, ...) function. thx...

Share this post


Link to post
Share on other sites
Advertisement
Naive implementation for converting from triangles to indexed triangles:

Allocate a new vertex array the same size as your existing one. (just incase)
Allocate a new index array the same size as your number of source vertices.

For each vertex in your source array:
Scan all vertices in your new output array looking for a match. (this is the naive slow bit)
If a match is found record found index
else copy vertex, record added index, incremement output vertex count.

Presto. A condensed vertex array and an index array you can pass to NvTriStrip.

Source vertex count and output index count are the same, with any luck output vertex count will drop dramatically. (If not your tristrips will be rubbish)

Share this post


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

  • Advertisement