terrain

Real-time terrain generation using marching cubes
git clone git://git.christianermann.dev/terrain
Log | Files | Refs | README | LICENSE

marching_cubes.h (415B)


      1 #ifndef MC_H
      2 #define MC_H
      3 
      4 #include "mesh.h"
      5 #include "sdf.h"
      6 #include "types.h"
      7 
      8 u32 MC_index(const Vec3 corners[8], SDF f, f32 isolevel);
      9 
     10 u32 MC_vertices(
     11         const Vec3 corners[8],
     12         SDF f,
     13         f32 isolevel,
     14         u32 mc_index,
     15         Vertex vertices[3]
     16 );
     17 
     18 u32 MC_indices(
     19         u32 mc_index,
     20         u32 vertex_offset,
     21         const u32 edge_offsets[12],
     22         u32 indices[15]
     23 );
     24 
     25 #endif