Archived

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

helix

Creating vertex buffers procedurally

Recommended Posts

My brain is imploding. I''ve been trying to procedurally create a triangle strip for a fairly simple object but I just can''t wrap my brain around it. Say for the following image:
  
          0____1
          /   /|
         /   / |
       2/___/3 |
     8__|   |  |___9
     / 4|   |  |5 /|
  12/   |   | /  / /13
   /   6|___|/7 / /
10/__________11/ /
  |____________|/
 14             15
  
(whew! ascii art is evil!) Let''s number the vertices as shown. What order would I add the vertices to my vertex buffer? I can take it as far as around the following before I get too confused and have a brain fart. 203175... etc lol help!

Share this post


Link to post
Share on other sites
I don''t think it''s possible to use a triangle strip for every possible mesh without using some degenerate triangles.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]

Share this post


Link to post
Share on other sites
You''re not going to be able to construct that object as one set of triangle strips. You have to group the different parts of it and draw them seperately. In this case, you would draw the base, then draw the thing sticking up out of it.

Share this post


Link to post
Share on other sites