POV-Ray : Newsgroups : povray.animations : Animation of Numerical Simulations : Animation of Numerical Simulations Server Time
23 Apr 2024 03:13:29 EDT (-0400)
  Animation of Numerical Simulations  
From: Sereib
Date: 25 Oct 2012 14:30:01
Message: <web.50898277955aa4a08be086270@news.povray.org>
Hi,

I would like to make animations based on a numerical simulation (e. g. the
dynamic of a globular cluster, or wave propagation). This would mean:

1) The parameter clock varies from e. g. 0 to 100 controlled by the ini file

2) In the scene file, the numerical simulation starts at t (time) = 0 and
proceeds to time = clock with a certain number of time intervals.

3) The result in rendered, and everything proceeds with step 1)

The problem is, that for each frame the numerical simulation always hast to
start at t = 0, e. g.:

Frame 1 (clock = 0.1): Simulation runs from t = 0.0 to 0.1, and renders the
result
Frame 2 (clock = 0.2): Simulation runs from t = 0.0 to 0.2, and renders the
result
Frame 3 (clock = 0.3): Simulation runs from t = 0.0 to 0.3, and renders the
result
Frame 4 (clock = 0.4): Simulation runs from t = 0.0 to 0.4, and renders the
result
...........

This means, povray has to calculate much more than really required. Thus it
would be helpful to buffer the result of each step, in order to proceed with
this result in the next step, so this would result in:

Frame 1 (clock = 0.1): Simulation runs from t = 0.0 to 0.1, and renders the
result
Frame 2 (clock = 0.2): Simulation runs from t = 0.1 to 0.2, and renders the
result
Frame 3 (clock = 0.3): Simulation runs from t = 0.2 to 0.3, and renders the
result
Frame 4 (clock = 0.4): Simulation runs from t = 0.3 to 0.4, and renders the
result
...........

This would require some kind of global variables which keep their value between
two animation steps called by the ini file. Any idea how this could be done?
Writing the variables (= e. g. the positions and speed vectors of the star
cluster calculated up to now) in a text-file, and importing it in the next
animation step?

Of course I could perform the simulation in e. g. visual basic and let visual
basic write output files with povray code, which could be included step by step
in the scene file. I assume this could be done via

#include(concat("c:\simulation_",str(clock,0,0),".inc"))

if the include files generated by visual basic are named "simulation1.inc",
"simulation2.inc", "simulation3.inc" ... ?

Any idea how to solve this solely with povray code?
Is there a tricky simple solution I just have overseen?

Thank you! Kind regards, Christian


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.