POV-Ray : Newsgroups : povray.programming : Can i output SDL results in a textfile? Server Time
22 Dec 2024 01:25:08 EST (-0500)
  Can i output SDL results in a textfile? (Message 1 to 3 of 3)  
From: amar
Subject: Can i output SDL results in a textfile?
Date: 6 Apr 2006 10:00:00
Message: <web.44351d74fab3a6433d9284750@news.povray.org>
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)

I would be verymuch thankful to anyone who can help me out with my problem.


thank you very much in advance

cheers
amar hegde


Post a reply to this message

From: Trevor G Quayle
Subject: Re: Can i output SDL results in a textfile?
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

From: David Wallace
Subject: Re: Can i output SDL results in a textfile?
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.