Shop Mobile More Submit  Join Login
Controls:
Keys 1-3: Change material
Mouse: repel
Mouse & shift: attract


Based on the paper Particle based viscoelastic fluid simulation. Modified with a massive amount of help from kotsoft.

910 particles. Sorry if it's a little slow, there's a fair bit of calculation being done here. I recommend downloading it, try running it standalone.


Coming soon: viscoelasticity (lololol), right now I'm just limited to varying viscous fluids, I'm struggling to find an efficient way of managing elastic / plastic materials.
Then again, this thing is pretty bogged down as it is. I've started playing with C# and XNA, I might just switch this over.
Add a Comment:
 
:iconsravanind:
sravanind Featured By Owner Mar 8, 2014
Hi,

nice demo. can please share source code, if possible

thanks
Reply
:iconspectrobe4:
spectrobe4 Featured By Owner Jun 7, 2013
link to game please?
Reply
:iconjestin12:
jestin12 Featured By Owner Feb 17, 2013
put a frekin ragdoll
Reply
Hidden by Commenter
:icon79089:
79089 Featured By Owner Apr 4, 2015  Hobbyist Artist
*crosses out not* *Top says: This is a joke!*
Reply
:iconstarblazer2155:
StarBlazer2155 Featured By Owner Aug 13, 2013  Hobbyist Digital Artist
your stupid muther f$cker shut the f$ck up please shut the hell up I WILL KILL YOU TONIGHT IF YOU DONT SHUT THE HELL UP!!!!!!!!!!!
Reply
:iconapplebloom5555:
Applebloom5555 Featured By Owner Jul 19, 2013  Hobbyist Artist
:iconchainfailplz:
Reply
:iconhappypenguinrock:
happypenguinrock Featured By Owner May 16, 2013  Student Artist
IT'S. NOT. TRUE.
Reply
:iconrenivid:
reniviD Featured By Owner Jan 2, 2011
Happy New Year!
I am also experimenting with SPH at the moment but I have problems with the mouse interaction. I tried to add some pressure to those particles around the point where I clicked with the mouse, but this doens´t gives the desired results. Do you have any hint for me ?
Reply
:iconniallmeister:
Niallmeister Featured By Owner Jan 2, 2011
You're on the right track with the idea of force, I think it kind of depends on how you're integrating the equations of motion for the particles. I'm using leapfrog integration and I just add a simple repellant force to the particle based on the distance:

var mRadius = 150;
var mForce = 10;

var dx = mouseX-p.x;
var dy = mouseY-p.y;
var d = dx*dx+dy*dy;
if (d < mRadius*mRadius) {
var fx = dx/d;
var fy = dy/d;

p.fx -= fx*mForce;
p.fy -= fy*mForce;
}


fx and fy are the components of a force vector for calculating accelerations later on. Does that make things any clearer?
Reply
:iconrenivid:
reniviD Featured By Owner Jan 2, 2011
Thank You for the immediate answer, now everything is clear :-)
I've just tried it, and it works. I think my mistake was to consider just the particles in the direct neighborhood of the mouse (radius = h) and not all in a wider radius. Furthermore I just changed the pressure of those particles and not directly the force.
The nice thing is, you can get the "attract mode" just by changing the -= to a += ;-)

I also used the algorithms of the pvfs-paper but my implementation runs much slower than your program.
With 400 particles (and around 1100 springs) the speed is about 20 fps.
To find quickly all particles in a neighborhood of a particle I currently use a Hash Grid but I plan to replace it with a QuadTree trusting that it is faster.
Reply
:iconniallmeister:
Niallmeister Featured By Owner Jan 2, 2011
I'm not sure a quadtree would necessarily be faster in flash - I've never tried it, but the structure in general is far more computationally intensive to manage than a simple uniform grid, which is what I'm using. Give it a go anyway I guess, let me know how it turns out!
Reply
:iconrobbeman:
robbeman Featured By Owner Dec 6, 2010  Hobbyist General Artist
Really nice job. Keep up the great work.
(reminds me of "spewer" ^^)
Reply
:iconthecheesegrater:
theCheeseGrater Featured By Owner Nov 20, 2010  Hobbyist Digital Artist
Very smooth i like it :)
Reply
:iconconquer001:
conquer001 Featured By Owner Oct 1, 2010
Wow... This is actually very nice.
Reply
:icontwistedsnail:
Twistedsnail Featured By Owner Sep 7, 2010
This is incredible!
Reply
:iconsylistra-the-scholar:
Sylistra-The-Scholar Featured By Owner Sep 4, 2010  Student Traditional Artist
This is really fun, lol.
Reply
:iconweganic:
weganic Featured By Owner Aug 9, 2010  Hobbyist Filmographer
wow, that's hard to make with flash-awesome!
Reply
:icondarren1337:
Darren1337 Featured By Owner Aug 8, 2010
I WANNA GET IN YOUR GREEN STUFF MMMMMMMM
Reply
:iconmiccool:
Miccool Featured By Owner Aug 6, 2010  Hobbyist Filmographer
I agree with highly
Reply
:iconhighly1:
HiGhLy1 Featured By Owner Aug 6, 2010
Best one yet!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Reply
Add a Comment:
 
×
Download SWF download, 5.1 KB




Details

Submitted on
August 6, 2010
Image Size
5.1 KB
Resolution
400×300
Link
Thumb
Embed

Stats

Views
10,845
Favourites
64 (who?)
Comments
21
Downloads
145
×