Flint Particle System Forum - Regular or non-random particle positioning: showing particles in a solid2011-12-11T10:34:44+00:00http://flintparticles.org/forum/
Lussumo Vanilla & Feed Publisher
Regular or non-random particle positioning: showing particles in a solidhttp://flintparticles.org/forum/comments.php?DiscussionID=500&Focus=1666#Comment_16662011-07-15T08:10:16+01:002011-12-11T10:34:44+00:00anvw01http://flintparticles.org/forum/account.php?u=519
Hi,
I'm trying to create 3 very simple representations of the behaviour of molecules in solid, liquid and gas form. You will remember such things from school science. Flint is great for the liquid ...
I'm trying to create 3 very simple representations of the behaviour of molecules in solid, liquid and gas form. You will remember such things from school science. Flint is great for the liquid and gas versions of the animation. But when I come to the representation of a solid, it seems a bit more tricky. What I want is a regularised (by that I mean - not random) display of particles, like an array or pattern. And then the particles need to vibrate or oscillate within their basically fixed positions: Always returning to their original positions while oscillating within a small individual zone.
I could probably do this from scratch in Actionscript but if there were a way of doing it with Flint that would be great. Any help is welcome. Even just a couple of pointers would be appreciated.
Thank you, Andrew]]>
Regular or non-random particle positioning: showing particles in a solidhttp://flintparticles.org/forum/comments.php?DiscussionID=500&Focus=1674#Comment_16742011-07-15T18:11:59+01:002011-07-31T18:14:25+01:00Richardhttp://flintparticles.org/forum/account.php?u=1
The whole idea of Flint is that it should be extendable by building custom Initializers and Actions. You'll have to build a couple, probably one of each. They shouldn't be too hard to create - ...
You'll want a custom initializer to place the particles in the grid. The PositionAbsolute class might be a good place to start from. The initialize method of your Initializer will be called once for each particle, so remember where you are in your grid and place each particle in the next position.
You'll also want a custom action to make the particles vibrate. You could do something like this - apply a randomised velocity to each particle at the start (use a DiscZone with the VelocityInitializer, for example) and then create an action that monitors the position of the particle and changes the velocity to move it back towards its start point when it gets too far away. You'll want to store the start point in the particle for future reference - store it in the particle's dictionary object.
The RandomDrift action is a simple example of an Action class. The main work is done in the update method, which is called once for each particle and each frame.
If you want to be more sophisticated, you could set each particle on a spring, centred at its start point, then apply a small force to make the particle vibrate. That would be great, but more complicated to do.]]>
Regular or non-random particle positioning: showing particles in a solidhttp://flintparticles.org/forum/comments.php?DiscussionID=500&Focus=1675#Comment_16752011-07-18T08:08:45+01:002011-12-11T10:34:44+00:00anvw01http://flintparticles.org/forum/account.php?u=519
Thanks - I'll give it a go!