0

So, my question that what function shoud I use, what is the fastest, or which is the most prevalent solution.

The solution alternatives: -the vertex array -polygon by polygon -or another alternative

An object has triangles, quads and polygons which has more indices. But the vertex array I know can store only triangles, quads, or something like that. But how can I render the polygons? Is it right that I only render polygon by polygon the polygons wich has more indices? (I've heard the glMultiDrawElements, but it has similar data structure if I render poly by poly, isn't it?)

Or there's a good alternative I don't know?

3Ducker
  • 346
  • 1
  • 9

1 Answers1

1

You should convert the polygons to triangles and use a vertex buffer object.

Freaxy
  • 93
  • 5
  • I've already thought about it, but where can I find a 3D trianguation algorithm for Pascal? – 3Ducker Feb 23 '14 at 13:14
  • @3Ducker simply read about [Polygon Triangulation](http://en.wikipedia.org/wiki/Polygon_triangulation) and make your own algorithm. – vallentin Feb 23 '14 at 13:51
  • @Vallentin it looks like simple but it's 2D. For the 2D, I found someon, and I've already compiled them. But for 3D, it's more difficult, more more. – 3Ducker Feb 23 '14 at 15:12
  • @3Ducker for 3D it's simply an extra dimension but still the same theory. So if you know the theory then you can make the algorithm. – vallentin Feb 23 '14 at 18:46
  • @Vallentin so you can do it in 4D? It's simply an extra dimension. – 3Ducker Feb 23 '14 at 19:32
  • @3Ducker Sure... Random example collision detection point vs point... 1D `(x1 == x2)`, 2D `((x1 == x2) && (y1 == y3))`, ... 4D `((x1 == x2) && (y1 == y3) && (z1 == z2) && (w1 == w2))` – vallentin Feb 23 '14 at 19:37
  • @Vallentin I belive that you can do collision detection point vs point in 4D, but can you do this with trianulation? I sure, there's a solution in 4D, like in 2D, but it way too difficult to a normal person. – 3Ducker Feb 23 '14 at 20:29
  • @3Ducker believe it or don't, but adding an extra dimension is easy because it's just everything else being repeated, mostly. – vallentin Feb 23 '14 at 21:02