POV-Ray : Newsgroups : povray.programming : Persistent Variables Server Time
28 Jul 2024 22:26:48 EDT (-0400)
  Persistent Variables (Message 11 to 12 of 12)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Nathan Kopp
Subject: Re: Persistent Variables
Date: 24 Nov 1999 13:10:52
Message: <383c2a2c@news.povray.org>
Nieminen Juha <war### [at] punarastascstutfi> wrote...
>
> #static Position = <1,2,3>; // like #local, but persistent
> #const Radius = 5; // same as #static, but makes it also unchangeable

Persistent things (objects or variables) should not have limited scope.  It
would be very difficult (if not impossible) for POV to know when the
object/variable should be brought back into scope in the next frame, since
#while and #if statements could drasitcally change the flow of the
scripting.  All persistent objects should have global scope.

My thoughts on the subject are as follows:

An INI or command-line option specifies if the animation is persistent or
not.  If the scene is persistent, ALL global (#declare) variables are
persistent.  All non-global variables (#local) are not persistent.  If you
want to re-declare the globals for the next frame, that's OK.  Remember, you
can #undef objects if you like.

If you want to put an object in the scene and give it a name so you can
change it later, you could use something like this:

#create mySphere=sphere{0,1 texture{mytex}}

You could #delete objects that were created (or maybe #undef them?).

Then, you could have by default all objects are persistent, and if you don't
want them to be persistent you have to name them (with #create) and then
#delete them.  Or, you could have all objects be not-persistent by default
and only those that are created and named using #create would be persistent.
I personally lean towards fully persistent scenes.  If you say
"Persistent_Animation=on" in the INI file, then all global variables and all
elements in the scene are persistent and you must #undef or #delete them if
you don't want them at the end of the frame.

-Nathan


Post a reply to this message

From: Nathan Kopp
Subject: Re: Persistent Variables
Date: 25 Nov 1999 23:09:03
Message: <383e07df@news.povray.org>
FYI, I've started work with persistent variables/scenes.

In my custom compile (not yet released), you can use an INI option to make
all global variables persistent.

You can also name objects in the scene and modify them.  All named objects
are currently persistent throughout an animation (no INI setting is
necessary).

-Nathan


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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