Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Triangulation_3 problem

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Triangulation_3 problem


Chronological Thread 
  • 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



Archive powered by MHonArc 2.6.16.

Top of Page