|
|
"Tony[B]" wrote:
> "Pretty straightforward"?!
Erm, hehe, pretty straightforward to *me* since I've done POV-script
particle systems before, so there was not much new in this one... :D
I'm also sure other's here who have worked with particle systems would think
that this one is nothing special. It looks nice nonetheless.
> I can't even imagine how to do that... Explain...
> please.
Ok, you asked for it. Let's see, where to start...
The core of the particle systems is two arrays, one containing the current
location of each particle and the other containing the last location.
There's also an array for the life of each particle (it goes downwards, and
when it reaches zero the particle dies) and one for the color (yes, all the
particles have slightly different colors).
The same calculations are done over and over again. In each calculation step
all the particles are moved slightly 1) , some particles die 2) and some new
ones are born 3).
1) Each particle is moved by it's current velocity (current location minus
last location) plus gravity. More forces could be added if necessary. The
life is also decreased by an amount.
2) In each calculation-step some particles die (Life goes below 0). It
seemed like I couldn't use #undef with individual array elements, so I set
the color to <0,0,0> instead and detected empty elements that way instead.
3) In each calculation step new particles are also created (they are created
in empty elements). Their initial "last" location is set equal to the
current position of the emitter-point. Their initial "current" location is
the same as the "last", but with some randomness added. The particle is also
given a color (user-defined color plus some randomness) and it's life is
initialised.
For each frame in the animation a number of calculation steps are done.
After the last step for a given frame, the glows are created according to
the latest calculated locations, and after that, file I/O is used to save
the data in a file to make it available to the next frame in the animation.
So you see, it's pretty straightforward! ;)
Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated January 28)
/ Also visit http://www.povrayusers.org
Post a reply to this message
|
|