POV-Ray : Newsgroups : povray.animations : please help me with #read : please help me with #read Server Time
1 Jun 2024 10:36:18 EDT (-0400)
  please help me with #read  
From: ferrari
Date: 20 Jun 2006 13:25:00
Message: <web.44982dad700a8a942e10ed0e0@news.povray.org>
hello, I am using #fopen and (#read) to read data from a list of this form:

1;
0.4;
4;
2.34;
5.67;
2.11;
etc...

I need to assign each value for the next frame in an animation.

1;      for frame 1
0.4;    for frame 2
4;      for frame 3
2.34;   for frame 4
5.67;   for frame 5
2.11;   for frame 6.....etc...

I use this code:

#include "AutoClck.mcr"
#declare Dur=3000;
#fopen Muestreo1 "muestreoc5-pd1.txt" read
#declare Fm1=0;
#declare Frames1=0;
Declare_From(Fm1,0)
#while(Frames1<(Dur))
#read (Muestreo1,S1)
Declare_To(Fm1,(Frames1)/(Dur-1),S1)
#declare Frames1=Frames1+1;
#end
sphere{0,1 translate<Fm1,0,0>}...etc....

where:
Dur is the dur in frames of the anim.
Fm1 is the name of variable ,S1 is the value of the "next variable" in the
list of textfile.(muestreoc5-pd1.txt)
this works fine but I don`t sure if this is the most efficient...
there is some other way to do it??????

thanks a lot!!!


Post a reply to this message

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