Converting Tri Fans to Tri Strips or Lists

Started by
0 comments, last by dx elliot 19 years, 6 months ago
Hi, can someone help me out here. I have a Solid Leaf BSP and my leafs are rendered as Tri Fans. However, every call i make, only has 4 or 5 vertices in it, then i call the Draw Primitive. I have my leafs sorted by textures prior to rendering, to cut down on state changes. my question is, can someone help me out with an algorithm behind converting a tri fan of vertices to a tri list so that i can cache them all into a vertex buffer, then into an index buffer for a performance enhancement. thanks much
Code makes the man
Advertisement
you just loop for the numvertices -2, that also gives the number of triangles. The order of them will be 0, i+1, i+2 (you can get some paper to see how it works). This will convert them to lists, which is usually better than strips to reduce render calls.

This topic is closed to new replies.

Advertisement