|
||||||||||
Dynamicles |
||||||||||
|
Description Dynamicles is a series of experiments with a home-grown particle dynamics system. Inspired by Karl Sims' "Particle Dreams" (Wiki) and numerous CG effects since. Applets These three are fairly well-behaved: These three mostly work, but do exhibit flaws: With source code: Algorithm There are a number of more capable, more elaborate and more "correct" libraries available for doing this sort of dynamics. My goal, however, was to create something simple enough to run in near real-time within Processing - at least for simple scenes involving relatively few particles versus a few surfaces. These are the results so far. A number of corners were cut to get the performance, and the results of those shortcuts are painfully visible in the applets above if you look for them. Turns out that it's a real pain to keep an infinitely small point from passing through an infinitely thin plane. Plus, I'm using single-precision floats, a first order Euler integrator, a relatively large time step, no modelling of resting contact force (ouch, that's a big omission), and allowing collisions from both sides of a surface (thus ruling out some hacks that might otherwise help). Problems are especially noticeable in concave shapes (any "coffee filters" or "saucers" in the applets above). Those leaks should not be occurring - but it's a mathematical nightmare at the bottom of those cones. As velocity fades from accumulated friction during collisions, and as dozens of nearby surfaces try to resolve simultaneous collisions, and as the particles never truly come to rest, and as the gravity force tends to overwhelm the equations at that point -- well, particles simply fall through the cracks eventually. I'm relatively happy with it, which turns out to be a Good Thing, since I'm already at or beyond my abilities to improve it further! Still, it serves its purpose: to adequately simulate a fountain or waterfall. Here's a movie of the fountain scenario above, rendered offline with 5000 particles, 96 triangles, (that's 480,000 collision tests per physics frame, yikes!) some transparency and motion blur:
|
||||||||||
|
||||||||||
© 2006 Dave Bollinger | ||||||||||