Marching Cubes/Voxel engine. Implementation and actual use

Hey all. I have a number of questions about Voxels, Marching cubes etc that I need to be awnsered specifically, as everywhere I look gives no clear definition or proper implementation of the Marching Cubes algorithm.

1. What exactly does it do?
Please do not link wikipedia, as I assure you. I have read over the links countless times.

2. What are it’s clear Implementations?
What can it be used for. Procedual destruction? Procedual environment production?

3. Why use it?
What benifits does it give to the user? Less memory use? Easier caching?

Please help me understand. I really would appreciate it as I am going to set one of my team coders on the sole job of procedually generated terrain that is editable and random. Is voxels/Marching cubes the best way to go.

Thanks for your understanding and commitment to helping me learn :slight_smile:
~Myhijim

I know you said no links but here is one anyway.
http://devblog.phillipspiess.com/2010/02/23/better-know-an-algorithm-1-marching-squares/

This isn’t the marching cubes algorithm, but the marching squares algorithm.
But (to my knowledge) the two are quite similar. Marching squares is 2d, marching cubes is 3d.

Voxels are the 3d equivalent of a pixel (I am pretty sure).

As you can probably tell, I know pretty much nothing on the subject.
I am just learning about it myself.

Study buddies xD
Thanks for the link… Already read haha

If that info on the voxels is correct, thank you, that clarifies alot

What kind of terrain you want to do…?

Similar to this

Bump

Does anyone at all have ideas on where to start with a voxel engine. I’ve been studying it hard but can’t seem to get it to click.
All I find are C# or other. I would probably be willing to spend my time translating. But where to start?

http://www.advsys.net/ken/voxlap.htm

Lets make a voxel engine seems awesome but I cant seem to figure it out.

I have also looked at the After playing Minecraft thread and downloaded a version to play with, alas it is in C#.

I also would like to write it myself… Not just rip off something blindly

My advice would be by learning C# - after all you’ve already found the resources so it makes sense to use 'em.

Yeah I was thinking of doing that…

(Man I can see this turning into another C# vs US battle) Haha

And pointers on where to start?

I’ve been compiling a list in my mind of all the things I think I need to learn :

Am I missing anything I shouldnt?
The ones with a question mark, I have found no real helpful sources for.

Also would I be able to translate : Let's Make a Voxel Engine
From OpenGL? to C# or US?

I keep seeing this Voxels Terrain stuff… What is it dynamic random terrain generation?

Yes.

I wanted to write my own Voxel engine similar to : https://sites.google.com/site/letsmakeavoxelengine/

But with Marching Cube implementation(Later On ) in order to make the environment more “smooth”

Assumes you know a little US

Depends on your skillz. I’m guessing a C# book aimed at intermediate programmers should be good for now. Later on you can learn the advanced features of C# but all you really need right now is to get used to the syntax differences and maybe recap the basics. Book wise I recommend safari-library as a excellent resource - alternatively there’s a ton of free tutorials via google.

Completely different kettle of fish - feel free to take a look but I expect it’s going to be too different to easily convert.

The algorithm is the same regardless of which language you implement it in. You shouldn’t need to know C# just because the resources you have found are in C#.

Correct, however knowing C# can make it much easier to understand the resources.

So what steps (For the voxel engine) would I need to take?

How would I achieve a randomized peril noise? Is that what I should be aiming for?
Then from there to generating a voxelised blah blah from there?

Can someone please give me a place to start :slight_smile:

I consider myself an intermediate programer, for this game I am currently coding I have made a fully fledged inventory and crafting system (Almost identical to minecraft).

http://forum.unity3d.com/threads/68764-LibNoise-Ported-to-Unity
Libnoise may be something you could use for procedural noise.

Either:

A) Find a good book/set of resources that take you from naught to hero.

B) DIY with experimentation googleing.

A while back I made a mandlebrot fractal in U3D. From there it wasn’t hard to start generating simple terrains, then making those terrains 3D was interesting… I stopped there because it wasn’t of great interest to me, but if you spend enough time thinking about the problems + a little reading you can usually ‘rediscover’ how these systems are made. Problem is you can spend a lot of time rediscovering basic formula - finding a good tutorial can save you a lot of time.

Now just to find that book/tutorial

EDIT:

Read this : http://freespace.virgin.net/hugo.elias/models/m_perlin.htm
VERY USEFUL

But I have no clue how to impleent it

Hi Myhijim.

I’m actualy working on marching cubes implementation in Unity.

http://forum.unity3d.com/threads/148452-Marching-Cubes-Infinite-Terrain-Infinite-Object-Fast-and-Optimized

You can generate infinite/random terrain with PerlinNoise , create objects for you game (destructible,deformable). Terrain is destructible, you can use it for mining or create trees for business lumberjack in your game. All is possible with marching cubes.

WOW. Thank you dyox!

Oh I have to buy it… Well Im sorta looking to learn not to just use someone elses script. Thank you anyway :slight_smile:

I am on my phone right now so I will probably come back later and expand on this further. What you are really researching is how to create is isosurfaces. Knowing that you should be able to fund tons or research papers on the different methodes that are used. Marching cubes is just an algorithmr creating the isosurface that became so popular that it is being thrown around more often than the real issue that it was created to solve.

I am currently working on a voxel engine as well that uses several techniques to develop isosurfaces and have found several faster alternatives to marching cubes that have similar results. I will probably be posting more on it later when I have all the texturing and editor tools built. I find this stuff really neat and interesting as well. If all goes well I hope to maybe give it away or sell the engine for $25 or something around that price point.

Dane