[Bf-committers] Surface from particles (Farsthary)

Raul Fernandez Hernandez raulf at info.upr.edu.cu
Thu Jan 21 21:22:07 CET 2010

Hi :)

  Thanks for the very fast repply !

 Yes, I'm using a marching cubes algorithm and also have implemented the
marching tetraedrom wich I have tested also , and while generate more
precise surfaces is also slower, so i guess it could be left as a quality
option for the user :)

> In general the fastest way to draw an array of triangles in OpenGL is
> with a VBO (vertex buffer object.) You can find examples of how to do
> this in source/blender/gpu/intern/gpu_buffers.c. (I think the VBO code
> was merged maybe two or three months ago? So your sources would need
> to be at least that recent in order to see the VBO code there.)
> The basic idea is that you set set up a buffer to hold your vertices
> (including at least vertex coordinates, plus optional normal and color
> data) using glGenBuffers and glBufferData, then set up a separate
> buffer object to hold the vertex indices that make up each triangle.
> Then you can draw using glDrawElements. (Buffer objects are pretty
> flexible, so you have a lot of control over how you split up your data
> into different VBOs; for example you don't have to use an index buffer
> object if you didn't have a lot of vertices used by multiple
> triangles.)

 I will try it starting tonigth, seems a powerfull solution, thanks :)

More information about the Bf-committers mailing list