POV-Ray : Newsgroups : povray.newusers : How to pass variables from one frame to the next Server Time
25 Nov 2024 22:31:09 EST (-0500)
  How to pass variables from one frame to the next (Message 1 to 5 of 5)  
From: Georg Olesen
Subject: How to pass variables from one frame to the next
Date: 10 Feb 2005 07:30:00
Message: <web.420b52fd9cf29933a278c9190@news.povray.org>
I'm making an animation of several frames. I would like to be able pass a
variable from one frame to the next. Is there any way of doing this?
In advance thanx
Georg Olesen


Post a reply to this message

From: Tim Nikias
Subject: Re: How to pass variables from one frame to the next
Date: 10 Feb 2005 08:18:46
Message: <420b5f36$1@news.povray.org>
AFAIK, you can do that with MegaPOV, but don't quote me on that, I don't use
MegaPOV.

You could also have a look at my I/O-Macros to save a variable to disc and
load it in the next frame... http://www.nolights.de/download.html#IO-Macros

Or you could write your own macros to do that.

Regards,
Tim

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

From: Mike Williams
Subject: Re: How to pass variables from one frame to the next
Date: 10 Feb 2005 09:50:19
Message: <Qw9nDGAAQ3CCFwSV@econym.demon.co.uk>
Wasn't it Tim Nikias who wrote:
>AFAIK, you can do that with MegaPOV, but don't quote me on that, I don't use
>MegaPOV.

Such a facility was in MegaPov 0.* but didn't get carried over to
MegaPov 1.* when the whole thing got rewritten using the POV 3.5 source.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Mike C
Subject: Re: How to pass variables from one frame to the next
Date: 9 Apr 2005 22:52:12
Message: <425894dc@news.povray.org>
"Georg Olesen" <vib### [at] hotmailcom> wrote in
news:web.420b52fd9cf29933a278c9190@news.povray.org: 

> I'm making an animation of several frames. I would like to be able
> pass a variable from one frame to the next. Is there any way of doing
> this? In advance thanx Georg Olesen 
> 
> 

How are you defining the variables in frame 1 vs, e.g., frame 2, 5, or
50? 

IIRC, randomly generated numbers will generate the same numbers in
sequence every time the frame is rendered, so you can just use the clock
variable * difference and tack that onto the original variable.  Right? 

To get a variable, you'd usually declare like #declare
valuea=macro(paramforframea); so you'd be able to move them between
frames by recalculating the calculation from the last frame, so in frame
b, you'd be able to get the thing in frame a by doing the same thing
again, right? 

Otherwise, I have no idea what you're trying to achieve.  And I'm not
even sure about this myself, it's just a guess.


Post a reply to this message

From: regdo
Subject: Re: How to pass variables from one frame to the next
Date: 11 Apr 2005 14:26:08
Message: <425AC14D.9060300@wanadoo.fr>
"Georg Olesen" <vib### [at] hotmailcom> wrote in
news:web.420b52fd9cf29933a278c9190@news.povray.org:


I'm making an animation of several frames. I would like to be able
pass a variable from one frame to the next. Is there any way of doing
this? In advance thanx Georg Olesen



In fact the solution depends on what type of variable you need.
If it's evolution is dependant on the frame number, you can use the 
"clock" variable (e.g : rotate clock*360*x for a complete rotation 
around x-axis in the entire animation).
If your variable is predictable for each frame, i.e you know how to 
compute it for each single frame, you can do so. Initiating a 
random-numbers stream and taking as many of them as the frame number 
gives you a "coherent" situation (as long as random numbers can be 
qualified that way) throughout the animation.
If you cannot know what was your variable's value on the frame before, 
then you can use a temporary file : write the variable in the file at 
the end of the script, read the variable from the file at the beginning. 
On first frame, initialise with whatever you need.

Does one of these methods match your need ?
Regis.


Post a reply to this message

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