|
|
Kevin Wampler wrote:
> Sweet! What's the coloring scheme?
For each pixel, initialise a particle to that starting point, and let it
wander under the influence of the attractors in the system. (Three
"magnets" plus a "string" force to simulate a gravitational pull towards
the center.) Colour each pixel according to the current X, Y coordinates
of the particle. (X = red, Y = green.)
It actually comes out looking far more interesting if you colour by
magnet proximity, and I'm investigating other possible colouring
algorithms too. (The sharp lines are where the red or green intensity
"wraps around" back to zero. They're not part of the actual system. It's
just quick and easy to implement the colouring this way to check whether
the rest of the program is working OK.)
Obviously, since all these particles are in motion, the image constantly
changes colour - most obviously with large repeating oscilations, which
gradually go out of phase with each other as various areas of particles
pass particularly near a magnet. Hence the fractal nature of the image.
If you're paying attention, you'll note that the magnets aren't *quite*
in a triangle formation; the top two are slightly too close together,
compared to the bottom one. Hence the lack of 3-fold symmetry.
There are *so* many animation possibilities here. You can animate the
orbits of the system, or you can show the system after X seconds and
move the magnets around. Or just change the colouring algorithm. (Thus
far I haven't used particle velocity at all yet...)
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|