Jump to content
  • Advertisement

Archived

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

lormax

unroll triangle

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

someone known the best way to "unroll" triangle strip or triangle fan into a triangle list (.md2 i hate you!!!!!!(in d3d))

Share this post


Link to post
Share on other sites
Advertisement
I thought that you could do Triangle Strips & Fans in D3D, you certainly can in D3D8. Failing that you could implement some kind of FIFO buffer that stores the last 2 verticies (or pointers to them), then those plus the current vertex will give you the triangle to draw, then shift the verticies down a slot and add the current vertex to buffer, before repeating the loop.

Actually come to think of it the best thing to do would be to create a vertex list with one vertex per vertex, then create and index list, and draw the verticies, as specified from the index list. Then for a triangle strip all you''d need to do is to create a index list along the lines of { 1,2,3, 2,3,4, 3,4,5, 4,5,6...}; simarly the index list for a triangle fan would be along the lines of {1,2,3, 1,3,4, 1,4,5, 1,5,6...}.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!