Subject: CGAL users discussion list
List archive
- From:
- To:
- Subject: Render a Polyhedron_3 using OpenGL vertex arrays
- Date: Wed, 7 Nov 2007 02:36:23 +0100
Dear all,
I would like to render a Polyhedron_3 mesh with +100K vertices in interactive
FPS using OpenGL.
(1) If the mesh is static, there is not problem:
- I can use a display list, build vertex arrays or use VBO (looping on the
Vertex_iterator, Facet_iterator). This is not my case.
(2) If the mesh geometry is dynamic (but the connectivity is static)
- It is possible to build a vertex array or VBO each time the geometry is
modified. However, I wouldn't like to loop on the iterators to build the new
opengl vertex array every time because is not efficient. I would like to pass
the pointer to the mesh geometry directly to OpenGL. I would like something
similar to (mesh is a pointer to a Polyhedron_3 object):
###############################
typedef Polyhedron_3::Point_iterator Point_iterator;
Point_iterator pi = mesh->points_begin();
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, sizeof(SOMESTRIDEVALUE), &(*pi)[0]);
glDrawElements(GL_TRIANGLES, 3*mesh->nfaces(), GL_UNSIGNED_INT, &faces[0]);
###############################
..... It is possible to do this? how to determine the STRIDE value?
(3) If the geometry and the connectivity is dynamic
- This is not my case
Thanks in advance,
Alvaro Cuno
COPPE-UFRJ
- Render a Polyhedron_3 using OpenGL vertex arrays, alvaroecp, 11/07/2007
- Re: [cgal-discuss] Render a Polyhedron_3 using OpenGL vertex arrays, Andreas Fabri, 11/07/2007
- Re: [cgal-discuss] Render a Polyhedron_3 using OpenGL vertex arrays, Laurent Rineau, 11/07/2007
- Re: [cgal-discuss] Render a Polyhedron_3 using OpenGL vertex arrays, alvaro cuno, 11/08/2007
- Re: [cgal-discuss] Render a Polyhedron_3 using OpenGL vertex arrays, Andreas Fabri, 11/08/2007
- Re: [cgal-discuss] Render a Polyhedron_3 using OpenGL vertex arrays, Andreas Fabri, 11/07/2007
Archive powered by MHonArc 2.6.16.