TESSELATE contourFinder output.

Hi ,
I would like to Tessellate the contour image acquired from OpenCv to use (the object) as convex object inside Physic Engine. I’ve been reading OpenGL have Tessellation method. Could be useful for this purpose? Anyone have idea how implement?

Best Regards

I found the tesselator in opengl (which we use for ofBeginShape()…) produces really acute angles that are bad for anything besides flat shading. I doubt they’d be good for a physics engine. They are way more like slivers (long, terribly skinny triangles) then a mesh.

much better is triangle, which does delauny triangulation and mesh generation. see here:

http://www.cs.cmu.edu/~quake/triangle.html

there is a c++ version :

http://www.compgeom.com/~piyush/scripts/triangle/

I’ve posted example code here of doing the triangulation of particles here – just for doing triangle - triangle comparison:

http://forum.openframeworks.cc/t/triangle-c+±wrapper–2d-mesh-amp;-delauny/547/0

you could use the same approach to get an array of good triangles. there are also some flags / options for making better meshes, but I didn’t play with triangle++. (have done this in triangle, though)…

good luck – I’m really curious about this and it would be nice to see the results !

zach