POV-Ray : Newsgroups : povray.general : Where to put initialisation code? : Re: Where to put initialisation code? Server Time
6 Oct 2024 09:52:19 EDT (-0400)
  Re: Where to put initialisation code?  
From: Ger
Date: 14 Apr 2014 13:31:41
Message: <534c1b7d$1@news.povray.org>
Le_Forgeron wrote:

> Le 14/04/2014 18:46, pbrants nous fit lire :
>> As the word says, initialisation instructions should be running just ONCE
>> before the calculation of an animation should start. If I put these
>> instructions in the POV-file which is to be animated with the INI-file
>> and clock-variable, then they are executed with each change of the clock.
>> How can I prevent this happening?
>> 
> 
> use a condition on clock or frame_number.
> 
> something like:
> 
> #if (clock <= 0)
> ...
> #else
> ...
> #end

All init stuff is lost at the start of the second frame unless it's written to a file.
At the start of any frame povray has no knowledge of what happened in the previous
frame unless stored.
So I would alter the example into

#if (clock <= 0)
  init your stuff
  #write stuff to disk
#else
  read stuff from disk
#end


-- 

Ger


Post a reply to this message

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