|
|
Hello,
I would like to generate an animation. The scene file contains
a lot of preparatory calculations (initializations). The following
is a reduced example.
// Initialization
#local R=seed(10);
#local J=0;
#while(J<10000)
#local POS[J]=<rand(R)*100, rand(R)*100, rand(R)*100>
#local J=J+1;
#end
// Drawing
#local J=0;
#while(J<10000)
sphere{ POS[J] + <clock*100,0,0> ,1}
#local J=J+1;
#end
For a 1000-frame animation, the whole scene file will need to
be run 1000 times, including the initialization part.
However, I think it is not needed and just a waste of time.
How can I omit the 999-time calculations and let my PC do the
calculation only once?
Post a reply to this message
|
|
|
|
Am 19.01.2011 12:28, schrieb Tomohiro:
> Hello,
>
> I would like to generate an animation. The scene file contains
> a lot of preparatory calculations (initializations). The following
> is a reduced example.
>
>
> // Initialization
> #local R=seed(10);
> #local J=0;
> #while(J<10000)
> #local POS[J]=<rand(R)*100, rand(R)*100, rand(R)*100>
> #local J=J+1;
> #end
>
> // Drawing
> #local J=0;
> #while(J<10000)
> sphere{ POS[J] +<clock*100,0,0> ,1}
> #local J=J+1;
> #end
>
> For a 1000-frame animation, the whole scene file will need to
> be run 1000 times, including the initialization part.
> However, I think it is not needed and just a waste of time.
> How can I omit the 999-time calculations and let my PC do the
> calculation only once?
You can use "#fopen" / "#write" / "#fclose" to auto-generate an .inc
file (and do this only on the very first frame), and then #include it
for all frames.
Post a reply to this message
|
|