Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Alpha Shape 3 and OpenGL

Subject: CGAL users discussion list

List archive

[cgal-discuss] Alpha Shape 3 and OpenGL


Chronological Thread 
  • From: Sidnei Basei <>
  • To:
  • Subject: [cgal-discuss] Alpha Shape 3 and OpenGL
  • Date: Fri, 1 Feb 2013 13:47:01 -0800 (PST)

Hi all,

I'm trying to reconstruct a 3d model from x,y,z cloud points. I used CGAL
Alpha Shape 3 with Delaunay triangulation to reconstruct it.

However, when I draw all triangles in OpenGL, I can see many holes (see
attached image).

I tried with many alpha options and these holes are still visibles.

My Code:

Alpha_shape_3 as(points->begin(),points->end(),Alpha_shape_3::NT(MyALPHA),
Alpha_shape_3::REGULARIZED);

Alpha_shape_3::Alpha_shape_facets_iterator
ffi=as.Alpha_shape_facets_begin();
for( ; ffi!=as.Alpha_shape_facets_end();ffi++) {
Triangle tr = as.triangle(*ffi);
out->push_back(tr);
}

In OpenGL:
for(std::vector<Triangle>::iterator
it=tBuffer->begin();it!=tBuffer->end();it++) {
Triangle t = (*it);
glBegin(GL_TRIANGLE_FAN);
{
for(unsigned short i=0;i<3;i++) {
Point p = t.vertex(i);
double vd[3] =
{(p.x()-center->x()),(p.y()-center->y()),(p.z()-center->z())};
glNormal3dv(vd);
glVertex3dv(vd);
}
}
glEnd();
}

Any Idea??? Thank you a lot.


<http://cgal-discuss.949826.n4.nabble.com/file/n4656638/Screen_Shot_2013-02-01_at_7.38.29_PM.png>
.



--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Alpha-Shape-3-and-OpenGL-tp4656638.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.18.

Top of Page