PDA

View Full Version : 2D polygon to 3D polygon triangles generation

Victor Hugo
03-04-2009, 03:20 PM
Hi all,

I have a program where I pick a 2d polygon and his height from a spatial database. I choose a reference point in WGS84 from the points returned, and then I compute the relative points which will be the 3D vertices. Until here everything is ok, however I need to output the mesh in OBJ format. To do that, I need to specify the mesh faces. How can I compute the triangles in order to get it correctly rendered ?

What keywors should I search for this topic ?

ZbuffeR
03-04-2009, 03:41 PM
delaunay triangulation ?
http://www.cs.cmu.edu/~quake/triangle.html

Otherwise if you need full 3D surface reconstruction from points, you may search for "ball pivoting" algorithms.
Meshlab has one :
http://meshlab.sourceforge.net/

Victor Hugo
03-04-2009, 03:54 PM
Hi,

Thanks for helping.

I can triangulate the 2d polygon using Triangle and then duplicate each triangle changing the z value, that will give me the roof and the floor of the polygon, but the faces that connect roof with floor how should i generate them ?

Any Ideas ?

Victor Hugo
03-04-2009, 03:55 PM
Ok will look at meshlab, currently I'm using it and it works very good for mesh simplification.

Thanks.

ZbuffeR
03-04-2009, 04:12 PM
Anyway I don't fully understand why you need to dynamically reconstruct the triangles when picking your 2D polygon.

You don't have any connectivity information between vertices ?

If your 3d mesh is simply a flat 2D polygon which has been vertically extruded, it is trivial to get the full triangle mesh.

MaxH
03-04-2009, 05:42 PM
If your 3d mesh is simply a flat 2D polygon which has been vertically extruded, it is trivial to get the full triangle mesh. What he said.