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 16:39:40 EDT (-0400)
  Re: Can i output SDL results in a textfile?  
From: David Wallace
Date: 10 Apr 2006 12:47:33
Message: <443a8c25$1@news.povray.org>
That's how my mesh generator macros work.  It makes it much easier to use the 
resultant meshes.

Trevor G Quayle wrote:
> "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

You can do this also:

#macro RndBalls(oFile,oSeed)
> #fopen OutFile1 oFile write
> 
> #local RND=seed(oSeed);
> #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

then

RndBalls("rballs.inc",1)
#declare rBalls = union( #include "rballs.inc" )

> 
> //end
> 
> -tgq
> 
> 
> 

--------------
David Wallace
TenArbor Consulting
"Just In Time Cash"
www.tenarbor.com
1-866-572-CASH


Post a reply to this message

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