3D cloth simulation in Flash

OK so the huge game is over and about to be published (link coming here soon).

Now I’ve had a chance to catch my breath I’ve realised that I have loads of tech demos that never really made it online. So in order to make up for that I’m going be uploaded loads of little flash nuggets over the next few days.

Starting with this little demo to show the net ripple effect for the Phillips soccer shootout game we produced last year:

[kml_flashembed movie=”/wp-content/uploads/manual/2007/swfcontainer.swf” width=”400″ height=”300″ FVERSION=”8″ SCALE=”noscale” ALIGN=”left” SALIGN=”t” fvars=”swfFile=/wp-content/uploads/manual/2007/netrippledemo.swf ; swfWidth=800 ; swfHeight=600 ; frameSnapshot=40 ; swfScale=50 ; timeoutFrames=250″ /]

Anyone who was at my 3D presentation at FlashForward in Austin will have already seen this, but for those of you who couldn’t make it, here’s a brief explanation of how we did it!

First of all we made a grid of 3D points and connected them with virtual springs that knew how far apart they were from the points around them. This worked well but was just too slow!

So instead we faked it 🙂

Using a precalculated gradually diminishing sin wave, we moved each point in and out. The nearer the ball hit position, the more it moved. And the further away from the ball hit position, the more of a delay we applied to the point before we started it moving. And the result is above!

More demos coming soon.