Skip to content

C++ implementation of Marching Cubes algorithm, rendered with GLFW

Notifications You must be signed in to change notification settings

Krafpy/Marching-Cubes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Marching-Cubes

This project is inspired from Sebastian Lague's marching squares and marching cubes videos, as well as Coding Train's Coding in the Cabana video on this topic. Feel free to add any contribution. An improved version using compute shaders is available here.

Screenshot

Dependencies

This C++ code uses GLFW3 and GLEW libraries for the 3D rendering. The noise functions come from FastNoise library by Auburn. This project was originally developed on CodeBlocks IDE using GNU GCC compiler.

Controls

  • Drag the mouse to rotate around the generated shape;
  • space to generate a new random shape;
  • A to show/hide axes (red for x, yellow for y, blue for z);
  • B to show/hide wireframe box.

Improvements ideas

  • Complete the CellGrid::fillGrid() method to allow more advanced patterns (e.g. floored terrain, terracing);
  • Use compute shaders to generate the noise and the cubes/vertices;
  • Add UI to configure the noise function

Project ideas

  • Continuous terrain generator;
  • Simulate flocking behaviour with boids around the generated terrain.

Used resources

About

C++ implementation of Marching Cubes algorithm, rendered with GLFW

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published