POV-Ray : Newsgroups : povray.programming : Persistent Variables : Re: Persistent Variables Server Time
28 Jul 2024 18:15:36 EDT (-0400)
  Re: Persistent Variables  
From: Nieminen Juha
Date: 17 Nov 1999 05:46:27
Message: <38328783@news.povray.org>
Pabs <pab### [at] hotmailcom> wrote:
: Its about time persistent variables showed up in either the official of
: non-official versions of POV-ray

  It's easy. Write something like this at the beginning of the scene:

#if(clock=0)
  // set initial values to the persistent variables
#else
  #fopen iFile "variables.dat" read
  // read values for persistent variables from iFile
  #fclose iFile
#end

  At the end of the scene:

#fopen oFile "variables.dat" write
// write values of persistent values to oFile separated with commas
#fclose oFile

  I have used this method in my 'robots' irtc animation with success.

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


Post a reply to this message

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