Subject: CGAL users discussion list
List archive
- From: Philipp Moeller <>
- To:
- Subject: Re: [cgal-discuss] Triangulation_3 problem
- Date: Fri, 10 Feb 2012 12:08:55 +0100
- Organization: GeometryFactory
mysmax
<>
writes:
> Hello check this snippet
>
> // Finite edges indices.
> for( typename Triangulation_3<GT, TDS>::Finite_edges_iterator
> eit = T.finite_edges_begin(); eit != T.finite_edges_end(); ++eit) {
> gv << 2
> << V[(*eit).first->vertex((*eit).second)]
> << V[(*eit).first->vertex((*eit).third)]
> << "\n"; // without color.
> // << 4 << drand48() << drand48() << drand48() << 1.0; // random
> color.
> }
>
> how to render this output in opengl?.
If `V` is a map of indices to Vertex_handles and you want to draw lines
something like:
glBegin(GL_LINES);
Point_3 p1 = V[...]->point();
Point_3 p2 = V[...]->point();
glVertex3d(p1.x(), p1.y(), p1.z());
glVertex3d(p2.x(), p2.y(), p2.z());
glEnd();
should do it and should be reasonably fast if your triangulation is not
too large, although this approach is very naive.
--
Philipp Moeller
GeometryFactory
- [cgal-discuss] Triangulation_3 problem, mysmax, 02/10/2012
- Re: [cgal-discuss] Triangulation_3 problem, Sebastien Loriot (GeometryFactory), 02/10/2012
- Re: [cgal-discuss] Triangulation_3 problem, Philipp Moeller, 02/10/2012
- [cgal-discuss] Re: Triangulation_3 problem, mysmax, 02/10/2012
Archive powered by MHonArc 2.6.16.