Marching Squares

So I’ve spent the last week looking over various articles on ‘marching squares/cubes/tetrahedrons/triangles‘ whatever variation you want to talk about – and was getting no where.  Found out a few interesting things though.  The algorithm was actually patented ( though fortunately the patent expired a few years ago now as far as I can see ).  I find it strange when people patent algorithms, then again – companies try to patent colours.  So it’s a crazy world we live in.

Last night around midnight I thought I’d do a bit more research, and I found a really good explaination in a gamasutra article which explained it in a slightly different manner, and it immediately clicked.  So quickly I opened up flash, and whipped up a quick prototype.

Now obviously this is completely unoptomised, extremely slow, and not very detailed – however it’s a definite start, and I’m very excited.  And since it’s in flash, you’re all welcome to have a play : 

 

Marching Squares, Flash Prototype 1

Marching Squares, Flash Prototype 1

You can also click and drag the particles to new positions ( easier with the ‘movement’ check box turned off )

In other news, I’ve also thought of a new design element – which I think might tie together loose ends I had in the whole design concept. Going to run them past Snookle when he gets back from his trip before I post them here , however if they sound like a good idea, then the game will really start to come together nicely I believe!

 – Anthony

Advertisements

About aA

I'm a 28 year old Designer from Brisbane, Australia. I've got a keen interest in Motion Graphics, Illustration, and Game Design. View all posts by aA

2 responses to “Marching Squares

  • a|A

    Thanks for the comment!
    Currently there’s no interaction between the actual particles themselves. They spawn in a random position, and they have a random x, and y velocity – then they happily move around. The movement of the particles was just to show how the ‘skin’ moves and changes depending on the particle interaction.

    Was coded from scratch, yes. All I had was this image : Marching Square Cases Taken from here, And a lot of research from various other places. There’s a lot of talk about the cases on the net, and a lot about marching ‘cubes’ ( which is for working in a 3d space ), However there’s very little about actual implementations. Which is probably why mine is so inefficient.

  • wonko

    this is soo cool, what are the movement rules? looks like “flockmates” of 4,5 then 6 … have you looked at flocking algorithms, might be another interesting movement pattern for you to try.

    …and you coded this all from scratch? wow, I would not even know where to begin, very impressive

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: