Sign in to follow this  

NvTriStrip Problems...

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this