POV-Ray : Newsgroups : povray.general : Writing binary files with POV script Server Time
4 Aug 2024 06:10:08 EDT (-0400)
  Writing binary files with POV script (Message 8 to 17 of 17)  
<<< Previous 7 Messages Goto Initial 10 Messages
From: Marc Champagne
Subject: Re: Writing binary files with POV script
Date: 23 Aug 2003 07:53:31
Message: <Xns93E04FFEDA04CPOVMIKA@204.213.191.226>
"Ray Gardener" <ray### [at] daylongraphicscom> wrote in
news:3f465ced$1@news.povray.org: 

> How about this:
> 
> Use the existing file output functions to write
> a hex-ASCII version of your file, and then, in
> a POV INI file, use the Post_Scene_Command or
> Post_Frame_Command directive to execute a
> converter app to turn the text into binary form.
> 
> Ray Gardener
> Daylon Graphics Ltd.
> "Heightfield modeling perfected"
> http://www.daylongraphics.com
> 
> 
> 
> 
> "JC (Exether)" <no### [at] spamfr> wrote in message
> news:3f45d5c6$1@news.povray.org...
>> I would like to generate a df3 file directly from a pov script,
>> generating it from pigments, a bit like Gilles' makecloud macro. But I
>> had a look at the documentation, and it seems that you can only output
>> text to a file.
>>
>> So I was wondering if there was a trick to do it, and if not, if it's
>> going to be implemented in some next POVray version.
>>
>> JC
>> PS: I know I can generate images with povray and make a df3 file with
>> some utility, but I already have too much utilities installed and I'd
>> like to do it in one step.
>>

Being from the Unix arena, there is always a way even when it seems
impossible. Bright idea Ray! 

-- 
(MIKA) Marc Champagne
marcch.AT.videotron.DOT.ca
Montreal, CANADA


Post a reply to this message

From: nospam
Subject: Re: Writing binary files with POV script
Date: 24 Aug 2003 19:20:41
Message: <3f493f8c.4383761@localhost>
On Fri, 22 Aug 2003 10:35:17 +0200, "JC (Exether)" <no### [at] spamfr> wrote:

>I would like to generate a df3 file directly from a pov script, 
>generating it from pigments, a bit like Gilles' makecloud macro. But I 
>had a look at the documentation, and it seems that you can only output 
>text to a file.

For years I've been wishing that binary file read/write commands
would be added to povray (I once has a pov-script that was
rendering audio data to a text file.  I ended up writing it as
something like a uuencoded file and then having a separate
program to in turn convert that text file to the wave file).

However, it might is best that vinary I/O not be added.
Consider the ability to have a pov-script that in turn writes
a (binary) .exe file containing a virus?  Or what is to stop
povray from overwriting the system password file, or
command.com?


Post a reply to this message

From: Tim Cook
Subject: Re: Writing binary files with POV script
Date: 24 Aug 2003 19:53:19
Message: <3f494fef$1@news.povray.org>
nospam wrote:
> However, it might is best that vinary I/O not be added.
> Consider the ability to have a pov-script that in turn writes
> a (binary) .exe file containing a virus?  Or what is to stop
> povray from overwriting the system password file, or
> command.com?

The very same thing that prevents the text I/O feature of POV
from overwriting command.com with a text file: the inherent
pure-hearted goodness of the POV community. ;)


Post a reply to this message

From: Warp
Subject: Re: Writing binary files with POV script
Date: 24 Aug 2003 20:08:08
Message: <3f49535d@news.povray.org>
nospam <Pet### [at] nymaliasnetalmost> wrote:
> However, it might is best that vinary I/O not be added.
> Consider the ability to have a pov-script that in turn writes
> a (binary) .exe file containing a virus?  Or what is to stop
> povray from overwriting the system password file, or
> command.com?

  What stops it from doing it now?
  You can easily make a POV-script which overwrites c:\autoexec.bat with
some nasty command. You can make one which overwrites important system
files with 0-sized files (or containing whatever garbage you like).
  Support for binary writing does not add any additional danger which is
not there already.

  And the answer to the question: I/O restrictions.
  (In NT-based and Unix-based systems the OS will probably not allow
overwriting such files, but in older Windows systems it's very possible.)

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: JC (Exether)
Subject: Re: Writing binary files with POV script
Date: 25 Aug 2003 03:50:01
Message: <3f49bfa9$1@news.povray.org>
I understand that it is not possible with the current primitives due to 
that fact that they are text primitives. Still, I think that it would be 
interesting to have this possibility with extra primitives (like a 
POV-script write_char/read_char accepting any byte value). I spoke of 
DF3 files because that's what I had in mind, but there is plenty of 
examples where this could be usefull, like model conversion from pov to 
any other utility for example audio files and so on (pov-guys 
imagination is endless it seems).

There's always the possibility to run an extra converter program but it 
would be so nicer to have this built-in. I hope it will be possible in 
some future version of our beloved POVRAY.  :-)

JC

ABX wrote:
> On Fri, 22 Aug 2003 10:35:17 +0200, "JC (Exether)" <no### [at] spamfr> wrote:
> 
>>I would like to generate a df3 file directly from a pov script, 
>>generating it from pigments, a bit like Gilles' makecloud macro. But I 
>>had a look at the documentation, and it seems that you can only output 
>>text to a file.
>>So I was wondering if there was a trick to do it, and if not, if it's 
>>going to be implemented in some next POVray version.
> 
> 
> It was discussed a few times. It is not possible to make binary files.
> 
> 
>>JC
>>PS: I know I can generate images with povray and make a df3 file with 
>>some utility, but I already have too much utilities installed and I'd 
>>like to do it in one step.
> 
> 
> See text format called extended density_file format at
> http://staff.aist.go.jp/r-suzuki/e/povray/iso/df_body.htm
> 
> ABX


Post a reply to this message

From: Brendan Ryan
Subject: Re: Writing binary files with POV script
Date: 25 Aug 2003 08:53:55
Message: <3f4a06e3@news.povray.org>
JC (Exether) wrote:
> I would like to generate a df3 file directly from a pov script, 
> generating it from pigments, a bit like Gilles' makecloud macro. But I 
> had a look at the documentation, and it seems that you can only output 
> text to a file.
> 

What about endianess?  Maybe the first byte or something could be used 
to record the endianess used so that the data could be swapped if needed.

Brendan


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Writing binary files with POV script
Date: 25 Aug 2003 11:03:26
Message: <3f4a253e$1@news.povray.org>
In article <3f4a06e3@news.povray.org> , Brendan Ryan <bjr### [at] ritedu>  
wrote:

>> I would like to generate a df3 file directly from a pov script,
>> generating it from pigments, a bit like Gilles' makecloud macro. But I
>> had a look at the documentation, and it seems that you can only output
>> text to a file.
>
> What about endianess?  Maybe the first byte or something could be used
> to record the endianess used so that the data could be swapped if needed.

Nothing.  It does not matter.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: JC (Exether)
Subject: Re: Writing binary files with POV script
Date: 26 Aug 2003 03:00:59
Message: <3f4b05ab@news.povray.org>
Well, endianess can be taken into account by the primitives, you can 
have primitives outputing 4 bytes integers or IEEE floats so that you 
don't have to care about endianess. There could be a variable to give 
endianess of the machine too.

JC

Brendan Ryan wrote:
> JC (Exether) wrote:
> 
>> I would like to generate a df3 file directly from a pov script, 
>> generating it from pigments, a bit like Gilles' makecloud macro. But I 
>> had a look at the documentation, and it seems that you can only output 
>> text to a file.
>>
> 
> What about endianess?  Maybe the first byte or something could be used 
> to record the endianess used so that the data could be swapped if needed.
> 
> Brendan
>


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Writing binary files with POV script
Date: 26 Aug 2003 14:22:37
Message: <3f4ba56d@news.povray.org>
In article <3f4b05ab@news.povray.org> , "JC (Exether)" <no### [at] spamfr> wrote:

> Well, endianess can be taken into account by the primitives, you can
> have primitives outputing 4 bytes integers or IEEE floats so that you
> don't have to care about endianess. There could be a variable to give
> endianess of the machine too.
>
> Brendan Ryan wrote:
>> JC (Exether) wrote:
>>
>>> I would like to generate a df3 file directly from a pov script,
>>> generating it from pigments, a bit like Gilles' makecloud macro. But I
>>> had a look at the documentation, and it seems that you can only output
>>> text to a file.
>>>
>>
>> What about endianess?  Maybe the first byte or something could be used
>> to record the endianess used so that the data could be swapped if needed.

As said, to create df3 files, you don't need to know anything about
endianess.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: nospam
Subject: Re: Writing binary files with POV script
Date: 28 Aug 2003 18:53:33
Message: <3f4e5563.13380919@localhost>
On 24 Aug 2003 20:08:08 -0400, Warp <war### [at] tagpovrayorg> wrote:

>  And the answer to the question: I/O restrictions.
 
I had forgotten all about that.  :D


Post a reply to this message

<<< Previous 7 Messages Goto Initial 10 Messages

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