|
|
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
|
|
|
|
I'm not familiar with the autoclock include file, but here's how I would do
it (untested code):
#fopen Muestreo1 "muestreoc5-pd1.txt" read
#declare FileFrame = 1;
#while (FileFrame <= frame_number)
#read (Muestreo1, Fm1)
#declare FileFrame = FileFrame + 1;
#end
sphere{0,1 translate<Fm1,0,0>}...etc....
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
|