simple marching cubes example (3d noise blobs)

hi

following a discussion on this thread http://forum.openframeworks.cc/t/3d-swarm/966/0 , i started reading about marching cubes.

for those who dont know its a way of creating 3d volumetric shapes. you can read more about it here: http://en.wikipedia.org/wiki/Marching-cubes

the whole code is based on the explanations and source found here: http://local.wasp.uwa.edu.au/~pbourke/g-…-olygonise/

the source is here: http://www.rui-m.com/OF/marchingcubes/src.zip

in this example, each vertice gets its value from a perlin noise function according to their position in space. then mouseY controls the perlin noise field complexity, and mouseX controls the threshold value.

it was created in OF0.05, using the VectorMath addon, and the 3dUtils addon for the lights (its included n the source).

you can find some pictures of it here: http://www.flickr.com/photos/28501900@N07/

1 Like

Cool! This is really interesting. I’ve been meaning to look into voxel rendering as I’ve been pretty interested in using them.

hey man, thats awesome! glad you got it working so quickly!

this looks great !! nice…

I love paul bourke’s site - it’s always great to see his explanations put to use. he’s saved my life on multiple occasions.

thanks!

  • z

wow, thanks for sharing I will definately make some experiments with this in the near future!

Sweet! I was just thinking about making a voxel renderer myself when I found this! I think I’ll still make my own one though, as I’d like to have the learning experience. I can see a lot of uses for it in the future though

sweet :slight_smile:

Haha, realised that I had already posted in this topic before :stuck_out_tongue:

Anyway, I’ve been thinking of looking into octrees, as this seems like an efficient way of storing the data. I’ve been thinking about the possibility of particle attraction within an octree as well, but I think that the idea that I have in mind would likely take a *lot* of rendering time.

I think that I’ll probably write both a marching cubes renderer as well as a raytracer. I’ll keep you posted :slight_smile: