Linear interpolation on Plane (Marching Cubes) Let's assume I have the following cube.



Let's assume the isovalue = 0. I would like to draw the resulting triangles of the isosurface.

I know that first I define which values are inside or outside comparing them to the given isovalue and after that we correspond to a particular list of edges.

After that, we have somehow to linearly interpolate the points.
I have read on an article that using this formula $P = P_1 + \frac{(iso -V_1)(P_2-P_1)}{V_2-V_1}$ we can get the interpolated values. 

Can someone demonstrate to me how I can interpolate the points in this case ?
P1 and P2 in this case represent the actual coordinates of the vertices of the cube in your output mesh. These might be the same as the input coordinates of the function you're using, or they might not be, it's entirely up to you how you output them. A simple way to map them would be to just use integer coords, biased by half the resolution of your sample volume - so a mesh spanning 100^3 cubes would have coordinates from -50 to 50 on each axis.

So in the formula you describe, (iso - V1) / (V2 - V1) gives you the amount to interpolate by, and (P2 - P1) is a vector representing a single cube lattice edge along the axis you want.

Let's assume we're using unit sized cubes, +Y is up, and +Z is 'into' the screen.

In your cube above, you will have crossings on the three edges coming from the left-bottom-front corner. On the X and Z edges you will interpolate by 0.25 : (0 - (-1)) / (3 - (-1)) , and on the Y edge you will interpolate by 0.5.

So if the left-bottom-front corner is at the origin, your three mesh vertices will be at 
&lt;0.25, 0, 0> , 
&lt;0, 0.5, 0> and 
&lt;0, 0, 0.25>.

Apply the same formula to the right-top-back corner and you get &lt;0.5, 1, 1>, &lt;1, 0.5, 1> and &lt;1, 1, 0.5>

The only difference is the left-bottom-front corner values will be P1 and V1 in your formula as it is at the 'negative' end of the edges to be interpolated, and the right-top-back values will be P2 and V2 as it is at the 'positive' end.

Hope that all makes sense.