Playing With Particles Pt.2
Since my previous post I have had a chance to play around with a very basic implementation of soft body physics in Flash, using Verlet integration. Using lots of particles constrained into one blob would have required far more processing power than is feasible, and hopefully using Verlet integration will give the results I want without such a great performance cost. A very useful introduction and further details about the basics of the Verlet integration method can be found here, from Thomas Jakobsen. This paper describes in brief the algorithms that were developed for IO Interactive’s game ‘Hitman: Codename 47′, the details of the Verlet integration are abstract enough that they can be applied elsewhere. In this case, AS3!
After much trial and error I was able to get a simple version of verlet integration running for my blobs. After more tweaking, and adding a secondary internal boundary for stability, I was getting somewhere closer to the end result I wanted. As you can see there are still issues when the blobs collide with each other, and when the force applied to the blob is too great it can sometimes fold in on itself.
For this reason I decided to try and adapt some of what I had here and combine it with both the fluid filters I had already come up with, to merge boundaries, and the particle engine to control the position and velocity of the blobs.
Using a tweaked version of the soft body physics blobs (to fix some of the more erratic behaviour) I have so far only added the fluid filters (as shown above). Controlling the position of the blobs using Flint is proving to be a little more tricky and will likely require some reworking of the Verlet integration used. The performance at smaller scales such as above is quite satisfactory, but scaling it up to the large resolutions I will need means the frame-rate dropping to 10fps and below when a large number of blobs are colliding. Hopefully I can regain some of the lost performance by doing as much of the bitmap processing in Pixel Blender as possible, and controlling the particle motion with Flint.
About this entry
You’re currently reading “Playing With Particles Pt.2,” an entry on Blog.birdsigh
- Published:
- Thursday, February 11th, 2010 at 3:24 am
- Author:
- Tim Crook
- Category:
- Coding









![[Insert Jaws theme-tune here] @studiogpop @spazy_t @217jen [Insert Jaws theme-tune here] @studiogpop @spazy_t @217jen](http://farm7.staticflickr.com/6237/6365285631_2ba3b7964e_s.jpg)








1 Comment
Jump to comment form | comments rss | trackback uri