POV-Ray : Newsgroups : povray.animations : Passing variables between iterations Server Time
28 Jul 2024 14:31:03 EDT (-0400)
  Passing variables between iterations (Message 1 to 7 of 7)  
From: Richard Brooks
Subject: Passing variables between iterations
Date: 7 Sep 2000 16:29:42
Message: <39b7fab6@news.povray.org>
How can I pass a variable between frames rendering iterations in POV?

I'm running an 1800 frame animation, 30 frames per second, and I want a
different random number every 6 seconds (180 frames).

I created an array of 10 random numbers, and then used the clock to select
the number from the array. This works, but is sloppy and not truely random!

Is there a way to pass a value from one frame to the next?

--
Richard Brooks                 email: bro### [at] kmrmailkmrllmitedu
Work: (805)355-6583        Home: (805)355-6734
Range Systems Engineering (RAYTHEON)
Field Engineer, Commodore, Roi-Namur Yacht Club,
President & General Manager, Roi-Namur Television,
and just all arround nice guy!
Kiernan Re-Entry Measurements Site  Kwajalein Atoll
Roi-Namur, Marshall Islands
E 167 28' Long., N 9 23' Lat.


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Passing variables between iterations
Date: 7 Sep 2000 17:36:50
Message: <39b80a72$1@news.povray.org>
In article <39b7fab6@news.povray.org> , "Richard Brooks" 
<bro### [at] kmrllmitedu> wrote:

> Is there a way to pass a value from one frame to the next?

Using the file IO functions you can write them to a file and read them in
the next time.   The file IO functions are explained in the manual.


     Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Paul Wise
Subject: Re: Passing variables between iterations
Date: 7 Sep 2000 23:37:01
Message: <39B85E79.89A9E67C@student.murdoch.edu.au>
Richard Brooks wrote:

> How can I pass a variable between frames rendering iterations in POV?

You can use persistent variables in MegaPOV (
http://nathan.kopp.com/patched.htm ) but as far as I know they don't work
properly in the current version (0.5a)
- 0.5 worked though if you want it (I have it at home)
or you could try MegaPOVPlus cur ver 0.5a mod 0.3. (I don't know if it works)

--
Bye
Pabs


Post a reply to this message

From: John VanSickle
Subject: Re: Passing variables between iterations
Date: 8 Sep 2000 07:34:08
Message: <39B8CEB0.477C4A6B@erols.com>
Richard Brooks wrote:
> 
> How can I pass a variable between frames rendering iterations in POV?
> 
> I'm running an 1800 frame animation, 30 frames per second, and I want
> a different random number every 6 seconds (180 frames).

// these two lines are to eliminate a potential FP rounding error
#declare Frame=floor(clock*30+.5); // 30 comes from the frame rate
#declare Clock=Frame/30;

#declare Seed=seed(floor(Clock/6));

#declare MyRandomValue=rand(Seed);

MyRandomValue will change every six seconds.

Hope this helps,
John


Post a reply to this message

From: Philippe Debar
Subject: Re: Passing variables between iterations
Date: 8 Sep 2000 07:35:58
Message: <39b8cf1e@news.povray.org>
"Richard Brooks" <bro### [at] kmrllmitedu> wrote in message
news:39b7fab6@news.povray.org...
> How can I pass a variable between frames rendering iterations in POV?
>
> I'm running an 1800 frame animation, 30 frames per second, and I want a
> different random number every 6 seconds (180 frames).
>
> I created an array of 10 random numbers, and then used the clock to select
> the number from the array. This works, but is sloppy and not truely
random!
>
> Is there a way to pass a value from one frame to the next?

If the values where generated with rand(seed), can't re-generate them for
each frame?
Something like (from the top of my head and utterly untested) :

#declare aSeed=123;
#declare currentFrame=clock*1799;
#declare iterator=0;
#while (iterator=<currentFrame)
  #declare randomNumber=rand(aSeed);
  #declare iterator=iterator+180;
#end


Povingly,


Philippe


Post a reply to this message

From: Warp
Subject: Re: Passing variables between iterations
Date: 8 Sep 2000 07:49:45
Message: <39b8d258@news.povray.org>
Philippe Debar <phi### [at] hotmailcom> wrote:
: #declare aSeed=123;

:   #declare randomNumber=rand(aSeed);

  I don't think this will work.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Philippe Debar
Subject: Re: Passing variables between iterations
Date: 8 Sep 2000 08:12:01
Message: <39b8d791@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:39b8d258@news.povray.org...
> Philippe Debar <phi### [at] hotmailcom> wrote:
> : #declare aSeed=123;
>
> :   #declare randomNumber=rand(aSeed);
>
>   I don't think this will work.

ooops

#declare aSeed=seed(123);


Post a reply to this message

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