Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] infinite facet in finite_facets_iterator?

Subject: CGAL users discussion list

List archive

[cgal-discuss] infinite facet in finite_facets_iterator?


Chronological Thread 
  • From: <>
  • To:
  • Subject: [cgal-discuss] infinite facet in finite_facets_iterator?
  • Date: Fri, 4 Dec 2009 17:25:32 +0100 (CET)

Hello everybody.
I'm Vinícius and this is my first post in this list. I'm using CGAL and OpenGL
to draw terrain as Delaunay Triangulation for my graduation project. Im trying
to draw all the triangles using the finite_facets_iterator but when the OpenGL
renders the terrain there are some facets that are going to a point which is
not in the data input and this point is very far away from the others. This
event is ocurring independent of the data input because I tested it with some
different cases. I think that point is the infinite vertex but this is not
possyble. Can someone give me a hand in this situation? The code is below.

void Terreno::desenharTerreno(){

Finite_facets_iterator3 facetsIter;
Vertex_handle3 v;
Cell_handle3 cell;
Point3 p;
double x , y , z;
int i;

glColor3f(1.0 , 1.0 , 1.0);
glPolygonMode(GL_FRONT_AND_BACK , GL_FILL);

for(facetsIter = tri->T.finite_facets_begin(); facetsIter !=
tri->T.finite_facets_end(); ++facetsIter){
cell = facetsIter->first;
i = facetsIter->second;

glBegin( GL_TRIANGLES );
for(int j = i + 1 ; j <= i + 3 ; j++){
v = cell->vertex(j % 3);
p = v->point();
x = p.cartesian(0); y = p.cartesian(1); z = p.cartesian(2);
glVertex3d(x , y , z);
}
glEnd();
}

glColor3f(0.0 , 0.0 , 0.0);
glPolygonMode(GL_FRONT_AND_BACK , GL_LINE);

for(facetsIter = tri->T.finite_facets_begin(); facetsIter !=
tri->T.finite_facets_end(); ++facetsIter){
cell = facetsIter->first;
i = facetsIter->second;

glBegin( GL_TRIANGLES );
for(int j = i + 1 ; j <= i + 3 ; j++){
v = cell->vertex(j % 3);
p = v->point();
x = p.cartesian(0); y = p.cartesian(1); z = p.cartesian(2);
glVertex3d(x , y , z);
}
glEnd();
}
}


Best regards,
Vinícius da Silva.


Archive powered by MHonArc 2.6.16.

Top of Page