POV-Ray : Newsgroups : povray.general : Workarounds for persistent variables. Server Time
31 Oct 2024 23:27:43 EDT (-0400)
  Workarounds for persistent variables. (Message 1 to 3 of 3)  
From: gregjohn
Subject: Workarounds for persistent variables.
Date: 9 Mar 2005 12:15:01
Message: <web.422f2e68d98bb7e240d56c170@news.povray.org>
What's the smartest SDL coding option to replace what might have been done
with persistent variables?

1) Recalculating the events of  frames 1 to n-1 for every nth frame;

2) writing to disk each time there's an event that needs to be remembered.
Q: What happens however upon each re-opening of a file-- will the old
material that's in the file be discarded, or are newly written records
appended at the end?


Post a reply to this message

From: Mike Williams
Subject: Re: Workarounds for persistent variables.
Date: 9 Mar 2005 15:49:13
Message: <EB0yfAADF2LCFwrV@econym.demon.co.uk>
Wasn't it gregjohn who wrote:
>What's the smartest SDL coding option to replace what might have been done
>with persistent variables?
>
>1) Recalculating the events of  frames 1 to n-1 for every nth frame;
>
>2) writing to disk each time there's an event that needs to be remembered.

Which one is smartest depends on how long it takes to calculate the
changes from one frame to the next.

If the calculations are quick, recalculate each time. Once you know how
to calculate one frame it's easier to write a simple loop round the
calculation than to add file handling.

If the calculations are slow, write to disk.

>Q: What happens however upon each re-opening of a file-- will the old
>material that's in the file be discarded, or are newly written records
>appended at the end?

The #fopen command has a "write" option which zaps any existing data,
and an "append" option which appends the data to the end.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Greg M  Johnson
Subject: Re: Workarounds for persistent variables.
Date: 14 Mar 2005 21:52:29
Message: <42364ded@news.povray.org>
"Mike Williams" <nos### [at] econymdemoncouk> wrote in message 
news:EB0### [at] econymdemoncouk...

>
> The #fopen command has a "write" option which zaps any existing data,
> and an "append" option which appends the data to the end.
>

Wow.  did not know that.


Post a reply to this message

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