POV-Ray : Newsgroups : povray.general : External data for animations? : Re: External data for animations? Server Time
14 Nov 2024 17:12:25 EST (-0500)
  Re: External data for animations?  
From: Ron Parker
Date: 21 May 1999 18:20:08
Message: <3745ce08.0@news.povray.org>
On Fri, 21 May 1999 18:05:20 -0300, Simon de Vet wrote:
>At work I use a nice little program called Interactive Physics...
>simulates motion. It can also output measurements (position, rotation,
>etc) to a text file.
>
>Obviously, if I could combine POV and this file, amazing animations
>could be made. Is there any easy way to do this? It is a text file for a
>falling (and bouncing) square with columns for frame number, xpos, ypos,
>and rotation.

First, massage the data file into something the file read stuff in 
POV can understand.  You might need to write some code for this part.

While you're rendering your animation, you can find the frame number
using clock and clock_delta (actually, only if the clock is zero on
the first frame, but you can always add a constant if it's not.)  

Now, just read through the file until you find the right frame number
and use the data in that row.  Parse time might suffer, but you can't
have everything. :)

Alternatively, of course, you could write a Perl script (or some other 
language, I'm just partial to Perl) to convert the data file into a big 
#switch and some supporting code and just #include it, letting the 
compiled C code in the POV parser do what you would have had to do in 
interpreted POV-Script.


Post a reply to this message

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