Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions Assets/MarchingCubes/Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace MarchingCubesProject
{

public enum MARCHING_MODE { CUBES, TETRAHEDRON };
public enum MARCHING_MODE { CUBES, COMPACTCUBES, TETRAHEDRON };

public class Example : MonoBehaviour
{
Expand Down Expand Up @@ -40,6 +40,8 @@ void Start()
Marching marching = null;
if(mode == MARCHING_MODE.TETRAHEDRON)
marching = new MarchingTertrahedron();
else if (mode == MARCHING_MODE.COMPACTCUBES)
marching = new CompactMarchingCubes();
else
marching = new MarchingCubes();

Expand All @@ -62,11 +64,11 @@ void Start()
{
for (int z = 0; z < depth; z++)
{
float u = x / (width - 1.0f);
float v = y / (height - 1.0f);
float w = z / (depth - 1.0f);
voxels[x,y,z] = fractal.Sample3D(u, v, w);
float u = x / (width - 1.0f);
float v = y / (height - 1.0f);
float w = z / (depth - 1.0f);

voxels[x,y,z] = fractal.Sample3D(u, v, w);
}
}
}
Expand Down
Loading