POV-Ray : Newsgroups : povray.newusers : How to pass variables from one frame to the next : Re: How to pass variables from one frame to the next Server Time
3 Sep 2024 08:17:36 EDT (-0400)
  Re: How to pass variables from one frame to the next  
From: regdo
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.