POV-Ray : Newsgroups : povray.advanced-users : --( Input/Output TEXT - Assign to Variables )-- Server Time
25 Nov 2024 07:17:58 EST (-0500)
  --( Input/Output TEXT - Assign to Variables )-- (Message 1 to 3 of 3)  
From:
Subject: --( Input/Output TEXT - Assign to Variables )--
Date: 19 Mar 2003 17:53:56
Message: <3e78f504@news.povray.org>
--------------( oo )--------------

I'm looking for a way to keep in memory some Variables over a frame state. I
tought using Input/Output text (.txt) as external parameters in POVRAY to
keep an initial state and reimport every state at the begining of each new
frame.

My problem is that I have scene state wich is the position of every state of
Cells on a Grid and I would like to be able to call back the previous state
of cells after each frames. This could be formatted in a .txt file.

Is there a way to Input/Output text and assign text elements to new
variables?
Is there a way to keep Variable defined over an animation?

I'm currently working on Cellular Automata and Genetic Algorithms. I'm
planning to use PovRay for renders. I have states wich is the position of
the elements in the scene. The previous state influence the second for each
frames.

--------------( oo )--------------

Architecture CAAO Website[UDM]-
http://ps.dgtic.umontreal.ca:2050/data/p0034/site


Post a reply to this message

From: Tim Nikias v2 0
Subject: Re: --( Input/Output TEXT - Assign to Variables )--
Date: 19 Mar 2003 18:52:32
Message: <3e7902c0@news.povray.org>
So, if its just data (floats, vectors up to 5 dimensions), I've got
some IO-Macros on my homepage designed for ease of use:

#declare Array=array[x][y] { ... }
Save_Array(Array,"filename.ext")

#declare Array=Load_Array("filename.ext");

As for filenames, you'd have to save them in strings, but my
system wasn't designed (and tested) for that. Concerning the
state-loading:
#if (frame_number=0)
 [Initial setup]
 Save_Array(Initial_Data,"somedata.tmp")
#else
 #declare Initial_Data=Load_Array("somedata.tmp")
#end

This way, the initial frame will calculate the new data into an
array, and every frame thereafter will load the data. This assumes
that your first frame is 0, not 1 (which you would have to change
in the if-statement).

To generate identifiers, it is possible to "parse" strings:
#declare String="#declare Variable="
Then write this to HD and #include the newly created file.
I'm not so sure if "#declare Variable=" works though, cause
I think that you'd have to define the part behind "=" inside
the include-file as well, but you might experiment with that
knowledge...

Hope this gets you going,
Tim

--
Tim Nikias v2.0
Homepage: http://www.digitaltwilight.de/no_lights
Email: Tim### [at] gmxde


>
> --------------( oo )--------------
>
> I'm looking for a way to keep in memory some Variables over a frame state.
I
> tought using Input/Output text (.txt) as external parameters in POVRAY to
> keep an initial state and reimport every state at the begining of each new
> frame.
>
> My problem is that I have scene state wich is the position of every state
of
> Cells on a Grid and I would like to be able to call back the previous
state
> of cells after each frames. This could be formatted in a .txt file.
>
> Is there a way to Input/Output text and assign text elements to new
> variables?
> Is there a way to keep Variable defined over an animation?
>
> I'm currently working on Cellular Automata and Genetic Algorithms. I'm
> planning to use PovRay for renders. I have states wich is the position of
> the elements in the scene. The previous state influence the second for
each
> frames.
>
> --------------( oo )--------------

> Architecture CAAO Website[UDM]-
> http://ps.dgtic.umontreal.ca:2050/data/p0034/site
>
>


Post a reply to this message

From:
Subject: Re: --( Input/Output TEXT - Assign to Variables )--
Date: 20 Mar 2003 13:19:30
Message: <3e7a0632$1@news.povray.org>
--------------( oo )--------------

Danke Tim!

I'll try to experiment with that and I'll give you informations.

--------------( oo )--------------

Architecture CAAO Website[UDM]



"Tim Nikias v2.0" <tim### [at] gmxde> wrote in message
news:3e7902c0@news.povray.org...
> So, if its just data (floats, vectors up to 5 dimensions), I've got
> some IO-Macros on my homepage designed for ease of use:
>
> #declare Array=array[x][y] { ... }
> Save_Array(Array,"filename.ext")
>
> #declare Array=Load_Array("filename.ext");
>
> As for filenames, you'd have to save them in strings, but my
> system wasn't designed (and tested) for that. Concerning the
> state-loading:
> #if (frame_number=0)
>  [Initial setup]
>  Save_Array(Initial_Data,"somedata.tmp")
> #else
>  #declare Initial_Data=Load_Array("somedata.tmp")
> #end
>
> This way, the initial frame will calculate the new data into an
> array, and every frame thereafter will load the data. This assumes
> that your first frame is 0, not 1 (which you would have to change
> in the if-statement).
>
> To generate identifiers, it is possible to "parse" strings:
> #declare String="#declare Variable="
> Then write this to HD and #include the newly created file.
> I'm not so sure if "#declare Variable=" works though, cause
> I think that you'd have to define the part behind "=" inside
> the include-file as well, but you might experiment with that
> knowledge...
>
> Hope this gets you going,
> Tim
>
> --
> Tim Nikias v2.0
> Homepage: http://www.digitaltwilight.de/no_lights
> Email: Tim### [at] gmxde

>
> >
> > --------------( oo )--------------
> >
> > I'm looking for a way to keep in memory some Variables over a frame
state.
> I
> > tought using Input/Output text (.txt) as external parameters in POVRAY
to
> > keep an initial state and reimport every state at the begining of each
new
> > frame.
> >
> > My problem is that I have scene state wich is the position of every
state
> of
> > Cells on a Grid and I would like to be able to call back the previous
> state
> > of cells after each frames. This could be formatted in a .txt file.
> >
> > Is there a way to Input/Output text and assign text elements to new
> > variables?
> > Is there a way to keep Variable defined over an animation?
> >
> > I'm currently working on Cellular Automata and Genetic Algorithms. I'm
> > planning to use PovRay for renders. I have states wich is the position
of
> > the elements in the scene. The previous state influence the second for
> each
> > frames.
> >
> > --------------( oo )--------------

> > Architecture CAAO Website[UDM]-
> > http://ps.dgtic.umontreal.ca:2050/data/p0034/site
> >
> >
>
>


Post a reply to this message

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