1

I am newbie to Povray. I have coordinates for all beads with time in .XYZ file. Now I want to generate .png snapshot for each time, so that I can make movie using ffmpeg. My problem is this: I wanted to know, what is the format for file extension as loop variable.

In other words, i can read and generate snapshot at any particular time using following code:

fopen MyFile "confs.txt" read

 #while (defined(MyFile))
 #read (MyFile,Vector1,Vector2)  
 .......
 .......
 
 #end

Now I want to use another time loop with file extension as confs%d.txt, so that I can open and read million files and generate snapshot corresponding to each time.

Please give me your suggestions for using file extension as loop variable in Povray. This idea came from my C programming, where we use file extension as loop variable. If you have any other way of reading multiple files, please let me know.

Community
  • 1
  • 1
ankita
  • 11
  • 2

1 Answers1

0

Do the file I/O in an interpreted language, like a bash/csh/perl script. Write a script that loops over your files, in order, and:

  • converts each file to the POV commands that plot a bead at that coordinate
  • writes the commands to a file
  • runs the renderer on that file; the output image will be written to the input POV filename plus a file type, ex confs157.png

When done with all files (or even a subset), use Image Magick to combine them into an animation. For example, to create an animated GIF: convert confs*.png confs.gif Image Magick is nice because it's mostly stand-alone (it has some font dependencies that you can generally ignore) and so is usually easy to install in any OS.

Open the file in any web browser to view it. If you want interactive controls (pause, fast-forward, etc), use a native animation viewer.

greggT
  • 51
  • 1
  • 5