|
|
> So, in povray, how would one pseudo-code out a model that conserves energy
> and accounts for multiple fields (gravity of sun *plus* other planets,
> repulsion of *all* neighbors in a flock).
>
> ----- for each frame----
>
> p2=p1+v1 *dt
> a2= constant * (sum of new forces based on new location).
> v2=v1+a2
> KE2=constant(vlength(v2)^2)
>
> ... I'm stumped.
I've don't have a real clue on how you might solve this. Some interesting
links while googling where these:
About Energy as a whole, very straightforward and simple:
<http://rabi.phys.virginia.edu/105/2003/ps2s.html>
About some ballmenu for a Website, but right at the end, there's something
about energy conservation:
http://hep.itp.tuwien.ac.at/~ipp/aboutballmenuphysics.html
I'm not all too deep into these energy-theories etc and their scripting. But
if I'm not mistaken, you should just look to it that when two particles
exchange forces, their sum is zero. So, for example, you might just take all
movement vectors, and add them up. If the particles started from a resting
state, then they should add up to zero (unless there are things like
stationary particles or so). The resulting vector is the extra amount of
energy added to the system, and needs to be diminished. In turn, you might
just add a fraction of that vector to every particle, so that, in the end,
you get zero total energy.
But I'm really quiet fuzzy about this all and would just experiment with the
above technique to see if it works. If it doesn't, then google is back! :-)
--
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Email: tim.nikias (@) nolights.de
Post a reply to this message
|
|