   Marching cubes vs tetrahedra. weird problem..
  Hi Everyone,I'm making a program which uses marching-tetrahedra and I have a weird problem.I've made an example here (you can drag the points to change their values):demoThe problem is that, sometimes, the values at corners create triangles which are really just cubes.I imagined that marching tetrahedra would create smooth looking output. i.e. when one of the corners has value 100, and all other corners = 0, then it should produce a slope - not a right angle cube.Is this a known issue with marching tetrahedra?? Am I doing something wrong?Should I be using marching-cubes?I really could use some help here, I've been banging my head against this one for a few days now with no progress :(If anyone could please help, I'd really be grateful.Cheers,David   
  I'm kind of new in this sort of thing myself. I implemented the marching cubes algo and was kind of disappointed. Not sure what kind of results the march tetra is supposed to give, but I remember seeing a screen shot that did not impress me. Can't find the link now though. Take a look at this stuff. I have not had the time to implement any of this, but some of it looks interesting...http://www2.imm.dtu.dk/~jab/gallery/polygonization.htmlhttp://www.loria.fr/~pougetma/software/reconstruction/reconstruction.htmlhttp://www.cgal.org/Manual/last/doc_html/cgal_manual/Surface_mesher/Chapter_main.html (Open source, but a very vast and complicated lib)And this paper...'Locally Adaptive Marching Cubes through Iso-Value Variation'Sorry, I haven't been much help, but I hope this pushes you in the right direction.- Sid   ;  Thanks for the links, some of those look really interesting and could be used for the project I'm working on...Now, I've figured out why this problem occurs.The reason why is that I'm breaking the cube into 6 tetrahedra. (This is the same as the standard marching tetrahedra algorithm). All the tetrahedra share the same starting vertex, therefore, this vertex shares edges on all tetrahedra. The interpolated values result in the 'right-angle' cube which can be seen here: demo.My implementation is using the following vert indexes for the cube:top: 0,2,4,6  bottom: 1,3,5,7 (such that 0-1,2-3,4-5,6-7 form vertical lines).I broke this definition of a cube into six tetrahedra with these indexes:t0= 5,4,6,0t1= 5,6,7,0t2= 5,2,4,0t3= 5,2,0,3t4= 5,3,0,1t5= 5,0,7,1You can clearly see that all tetrahedra share the same leading vertex: 5, this is what I believe causes the right-angle cube artifact.So, the question is, what is the correct or standard way to break the cube into six tetrahedra?   ;  Old thread got my attention.You can find a nice explanation of marching cubes and tetrahedrons here:http://local.wasp.uwa.edu.au/~pbourke/geometry/polygonise/and some example code for both techniques here:http://local.wasp.uwa.edu.au/~pbourke/geometry/polygonise/marchingsource.cppFor the specific topic of how to break a cube into tetrahedrons, look for this function://vMarchCube2 performs the Marching Tetrahedrons algorithm on a single cube by making six calls to vMarchTetrahedronGLvoid vMarchCube2(GLfloat fX, GLfloat fY, GLfloat fZ, GLfloat fScale)