Creating vertex buffers procedurally

Started by
2 comments, last by helix 21 years, 6 months ago
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!
Advertisement
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 ]
ahh...that would explain why I kept getting lost. I think I''m just going to use some ID3DXMesh functions instead...
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.

This topic is closed to new replies.

Advertisement