POV-Ray : Newsgroups : povray.programming : Can i output SDL results in a textfile? : Re: Can i output SDL results in a textfile? Server Time
17 May 2024 18:45:50 EDT (-0400)
  Re: Can i output SDL results in a textfile?  
From: Trevor G Quayle
Date: 6 Apr 2006 10:40:01
Message: <web.4435280cba7394e26c4803960@news.povray.org>
"amar" <amar> wrote:
> Hello Everybody, First..i would like to thank to all those who responded and
> helped me with my previous quistion.I am verymuch new to povray/ray tracing,
> i have a question regarding SDL.
>
> 1) is it possible to output the result of a macro in SDL into a text file??.
> For example if i write a macro which would do some looping operations.. and
> give out some result.. can i output this result in a file?. can i do this
> with SDL or should i look into the source code of the programme.(if yes
> please..
> let me know where)
>

SDL will do what you want (3.2.2.3  File I/O Directives)

basically you need to create a file for input (#fopen)
then write a text string in your loop corresponding to the scene file
operation.

eg:

//start
#fopen OutFile1 "LoopOutput.txt" write

#local RND=seed(1);
#local i=0; #while (i<10)
   #local j=0; #while (j<10)
      #local k=0; #while (k<10)
         #local Rad=rand(RND)*0.5;
         sphere {<i,j,k>, Rad pigment{rgb 1}}
         #write(OutFile1,"sphere { ",<i,j,k>", ",Rad," pigment{rgb 1}}n")
      #local k=k+1; #end
   #local j=j+1; #end
#local i=i+1; #end

#fclose OutFile1

//end

-tgq


Post a reply to this message

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