POV-Ray : Newsgroups : povray.general : Reading coordinates into povray from an ascii file : Re: Reading coordinates into povray from an ascii file Server Time
29 Jul 2024 18:23:04 EDT (-0400)
  Re: Reading coordinates into povray from an ascii file  
From: bitman
Date: 13 Dec 2010 11:00:56
Message: <4d064338@news.povray.org>
On 12/13/2010 04:55 AM, John wrote:
> I've managed to #fopen and apparently #read the file successfully -- well, at
> ...
> Any syntactic hints?



Hi John

in one animation I write some variables into a file, to re read them with the next
frame.

Just write the declaration, you want to be read into the file, using the Povray
SDL-syntax:


	//===< Write Values to File
	 #fopen b1 "b1.inc" write
	  #write(b1,"\n#declare ST_Centre       =",ST_Centre      ,";")
	  #write(b1,"\n#declare ST_Normal       =",ST_Normal      ,";")
	  #write(b1,"\n#declare b1_pos          =",b1_pos         ,";")
	  #write(b1,"\n#declare b1_normal       =",b1_normal      ,";")
	  #write(b1,"\n#declare b1_speed        =",b1_speed       ,";")
	  #write(b1,"\n#declare bl_acceleration =",bl_acceleration,";")
	  #write(b1,"\n#declare b1_gravity      =",b1_gravity     ,";")
	  #write(b1,"\n#declare b1_resistence   =",b1_resistence  ,";")
	 #fclose b1


then you can just include this file in another run:

	#include "b1.inc"

that's it :)

BR
bitman


Post a reply to this message

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