   Marching Tetrahedra - triangle winding
  Hi,i have implementen Marching Tetrahedra (as well as Cubes). I need all triangles to hace same orientation on surface, so model is corectly enclosed.My idea was to calculate gradient (aka normal) at cell vertices using formula:-(F(i -1,j,k) - F(i+1, j, k))  .. cell corner at coordinates [i,j,k] (I am not dividing with step, because I have step of size 1)Thean I interpolate normal from cell corners same way as vertices of marched mesh. Triangle correction:From created triangle calculate normal Cross(v1 - v0, v2 - v0) //v0,1,2 -  triangle vertices and compare with normal at one of the verticesfloat nmbr = Dot ( triNormal, v0.Normal)if (nmbr < 0) SWAP(v0, v1)For some models is this approcah OK, and I got correct enclosed surface. But on others, I got small amount (compare to total size ov triangles) of triangles, that are oriented on other side.P.S: Orientation in 3D doesn´t exist, so I take orientation as two neighbour triangles has edges v0 - v1 vs v1 - v0 (correct) and not v0 - v1 vs v0 - v1 (incorrect)   
  If I understand marching tetrahedra correctly,  for each vertex of the tetrahedron you'll compute the sign of some function. Orient the triangles so that the normal (computed as the cross product of two consecutive sides) always points towards the direction in which the function is positive. Doesn't that just work?   ;  MarchingTetrahedra come out from Marching cubes. Initialize Cell is same, only than cell is divided to tetrahedrons. So calculations for nornals are same as in MC.  Well, thats what I am trying to do. I wrote steps I do in firt post. That should work in my oppinion but doesn´t .... maybe floating point precission ?   ;  I'll try to explain my previous post. Let's say you evaluate your function in a tetrahedron and you get these values: (-0.6, 1.2, 1.1, 0.7). You'll write a triangle here that separates the -0.6 vertex from the others. You have to pick an orientation for the triangle, and I suggest you use the orientation that would make the cross product of two consecutive sides point away from the -0.6 vertex. If you later find a tetrahedron whose vertices have values (0.6, -1.2, -1.1, -0.7) you'll generate the triangle in the opposite orientation.Notice that I don't need to compute the gradient at any time.   ;  I already have computed gradient, because of shading. So it should be faster repairing triangle net with using gradient, rather than caching.What i was trying to do is written in this article:[url="http://www.cs.uaf.edu/%7Egenetti/Research/Papers/ISMCR94/ismcr.html"]http://www.cs.uaf.edu/~genetti/Research/Papers/ISMCR94/ismcr.html[/url] - section Facet Rendering of Marching Cubes Output. It´s for Marching Cubes, but should work also for MT, because of same way of initializing cell.   ;  Your so-called "gradient" is a discrete approximation to a continuous notion, and I believe the problems you are seeing are the result of borderline cases where the approximation is not good enough.I don't know why you don't want to try what I am suggesting.   ;  So far I am using something like that you suggested, but it need memory for storing values. "Gradient" solution is memory cheap.   ;  What do you need memory for? I honestly don't see it... At some point you must have code that looks at a tetrahedron's vertices and decides whether a polygon should be generated. At that point, you know all you need to know to decide which way the polygon should face.   