POV-Ray : Newsgroups : povray.newusers : Avoiding re-parsing in animation. : Re: Avoiding re-parsing in animation. Server Time
4 Nov 2024 13:03:46 EST (-0500)
  Re: Avoiding re-parsing in animation.  
From: Miguel Garcia
Date: 10 Sep 2003 03:12:04
Message: <3f5ecec4@news.povray.org>
"Tim Nikias v2.0" <no_lights (@) digitaltwilight.de> wrote in message
news:3f5e81c3$1@news.povray.org...
> You'd have to use the #write commands.
> What you do, is open a file with
> #fopen Output "filename.ext" write
>
> "Output" is then a variable the #write commands
> use to identify into which file to write:
> #write (Output, Blabla)
> Blabla is then a string with whatever you like. If
> you have to put a vector or float/boolean in a
> string, do it like this:
> #write (Output, "Example-Vector:",Vector,"\n")
>
> the \n is a *return*, so the file will write in the
> next line. For a sphere, where Sphere_Center
> and Sphere_Radius are the parameters for the
> sphere:
>
> #write (Output, "sphere{",Sphere_Center,",",Sphere_Radius,"}\n")
>
> Problem with textures is, that you'd either have to write
> them by hand into the #write command, or you'd have to
> just place a variable instead, like
> #write (Output, "sphere{0,1 texture{Predefined_Texture}}\n")
> And somewhere before including the file in which this is
> all is written, you do
> #declare Predefined_Texture=texture{...}
>
> You might want to use
> #fclose Output
> After the file is finished, though POV-Ray will Auto-Close
> the open files once the end of the scene is reached. Then,
> around the entire file-writing process, make a switch:
> #if (frame_number=0)
>  [Write the File]
> #else
>  #include "File.ext"
> #end
> If you're first frame is actually numbered 1, then use
> #if (frame_number=1)
>
> That's just about it. Just keep in mind that #write
> only accepts strings, vectors and float (where boolean
> is interpreted to 0 or 1).
> The Docs should help getting the details right, e.g. you
> can use
> #fopen Output "filename.ext" append
> to not overwrite a file once it is opened, but rather add
> the lines after the already present data in that file.
>
> That should get you started.

Thanks a lot for your detailed instructions! It is much more than enough to
get started.

Cheers,

--

http://www.telefonica.net/web/miguelgdz/index.html


Post a reply to this message

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