POV-Ray : Newsgroups : povray.programming : Povray directly from C program Server Time
22 Dec 2024 01:20:23 EST (-0500)
  Povray directly from C program (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: Gerolf Ziegenhain
Subject: Povray directly from C program
Date: 21 Apr 2007 15:05:02
Message: <web.462a5f2ab06213d6fd73519f0@news.povray.org>
Hi,

Is it possible to use povray as some kind of library? Such that it could
directly be used from within a C program (whithout writing a text file with
the scene ;). I want to use it for visualizing atomistic simulations.

Best regards:
   Gerolf


Post a reply to this message

From: Warp
Subject: Re: Povray directly from C program
Date: 21 Apr 2007 17:01:47
Message: <462a7bbb@news.povray.org>
Gerolf Ziegenhain <nomail@nomail> wrote:
> Is it possible to use povray as some kind of library? Such that it could
> directly be used from within a C program (whithout writing a text file with
> the scene ;). I want to use it for visualizing atomistic simulations.

  You can't link POV-Ray into your program directly, as the usage license
expressly prohibits that.
  In Windows you can call POV-Ray using its extension mechanism (for
example Moray does that). In other systems I don't think there's much
choice.

-- 
                                                          - Warp


Post a reply to this message

From: Christoph Hormann
Subject: Re: Povray directly from C program
Date: 22 Apr 2007 04:35:03
Message: <f0f6fg$esa$1@chho.imagico.de>
Warp wrote:
> Gerolf Ziegenhain <nomail@nomail> wrote:
>> Is it possible to use povray as some kind of library? Such that it could
>> directly be used from within a C program (whithout writing a text file with
>> the scene ;). I want to use it for visualizing atomistic simulations.
> 
>   You can't link POV-Ray into your program directly, as the usage license
> expressly prohibits that.

Actually that's not precisely true, you cannot *distribute* a POV-Ray 
version modified this way, nothing prevents you from doing this just for 
yourself (except that it will be a lot of work(*) and you would not gain 
anything from it).

(*) remember that the input file need to be searchable, therefore you 
would have to create an internal buffer for it and modify the file 
access functions to use this buffer instead.

Christoph

-- 
Views of the Earth: http://earth.imagico.de/
Images, include files, tutorials: http://www.imagico.de/
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

From: Patrick Elliott
Subject: Re: Povray directly from C program
Date: 23 Apr 2007 04:31:39
Message: <MPG.20961cd8bdcf24b598a006@news.povray.org>
In article <f0f6fg$esa$1@chho.imagico.de>, chr### [at] gmxde says...
> Warp wrote:
> > Gerolf Ziegenhain <nomail@nomail> wrote:
> >> Is it possible to use povray as some kind of library? Such that it cou
ld
> >> directly be used from within a C program (whithout writing a text file
 with
> >> the scene ;). I want to use it for visualizing atomistic simulations.
> > 
> >   You can't link POV-Ray into your program directly, as the usage licen
se
> > expressly prohibits that.
> 
> Actually that's not precisely true, you cannot *distribute* a POV-Ray 
> version modified this way, nothing prevents you from doing this just for
 
> yourself (except that it will be a lot of work(*) and you would not gain
 
> anything from it).
> 
> (*) remember that the input file need to be searchable, therefore you 
> would have to create an internal buffer for it and modify the file 
> access functions to use this buffer instead.
> 
And as I fumbled around with a while back, its not infeasible, with the 
right constraints added, that you could "sort of" link it in, in the 
same way you might add a script engine. The requirements are that a) it 
can work as is, and b) that the fact you are using it isn't hidden. The 
only reason that linking it in isn't allowed is that it breaks one or 
both of those rules. But its not the only way you can link something. 
Mono or ActiveX could allow you to link it like a plugin, while still 
letting it run as a stand alone instance that works "as normal". That 
only breaks one of the rules then, that you can hide it. And as I 
pointed out in the other thread, if you force the developer to display, 
and prevent them hiding, the render window could be used to display the 
needed info on what is being actually being used.

Hmm. Lets use an example. There is IE and there is the "browser" object 
that lies at the core of I.E. Both use the same display, both conform to 
the same rules, can run the same script, etc. They are functionally 
identical to each other, save that one has its own window, and one lets 
you glue it to *your* window. You need on to use the other, so they are 
tightly bound to each other. Nothing the original does is effected or 
altered in any way by you using the simpler interface in the "browser" 
object to handle web pages. Why not do that with POVRay? Because, it 
breaks the, "show the license", rule. Now.. Lets say that the "browser" 
object, when it loaded, forced itself to stay visible for x seconds and 
auto loaded a page, built into the IE core, that showed the version 
number, the license and the copyright information. You couldn't avoid 
it. **Any** application using the object would have to display the 
information for x seconds, before it could go to a new page, or anything 
else, but it would only need to do it *once*, when you first initialized 
the object. Now it conforms to "both" rules. Its possible to run it as 
is, none of the functionality has changed at all *and* it shows the 
needed license information, etc., while "still" being embeddable.

How am I wrong? Other than that no one considered such a thing when 
stating that its not allowed?

-- 
void main () {

    call functional_code()
  else
    call crash_windows();
}

<A HREF='http://www.daz3d.com/index.php?refid=16130551'>Get 3D Models,
 
3D Content, and 3D Software at DAZ3D!</A>


Post a reply to this message

From: frfo
Subject: Re: Povray directly from C program
Date: 29 May 2007 15:58:39
Message: <465c85ef$1@news.povray.org>
I would suggest to use megapov (command line version on windows).
You launch it from your program with no input file, but with the "-" 
option in place of the input file. The you can feed it on the standard 
input with the scene description.

You still have to generate the scene in SDL, but you save all the stuff 
with temporary files.

I hope this helps.

Frederic


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Povray directly from C program
Date: 29 May 2007 22:24:42
Message: <465ce06a$1@news.povray.org>
frfo wrote:
> 
> I would suggest to use megapov (command line version on windows).
> You launch it from your program with no input file, but with the "-"
> option in place of the input file. The you can feed it on the standard
> input with the scene description.

That does not work. POV-Ray cannot read scenes from std input because std
input is not random access capable.

	Thorsten


Post a reply to this message

From: EinarDogfin
Subject: Re: Povray directly from C program
Date: 30 May 2007 11:02:52
Message: <87y7j6pd5w.fsf@gmail.com>
Thorsten Froehlich <tho### [at] trfde> writes:

> frfo wrote:
>> 
>> I would suggest to use megapov (command line version on windows).
>> You launch it from your program with no input file, but with the "-"
>> option in place of the input file. The you can feed it on the standard
>> input with the scene description.
>
> That does not work. POV-Ray cannot read scenes from std input because std
> input is not random access capable.
>
> 	Thorsten

From the man page:

   Parsing options:
       I<input_file_name> or Input_File_Name=file
              Specifies the input file to use.  If the input file name is '-',
              the scene description will be read from the standard
              input.  The

Odd that it cuts off like that, but there you go.


Ryan.


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Povray directly from C program
Date: 30 May 2007 11:59:08
Message: <465d9f4c$1@news.povray.org>
EinarDogfin wrote:
> Thorsten Froehlich <tho### [at] trfde> writes:
> 
>> frfo wrote:
>>> I would suggest to use megapov (command line version on windows).
>>> You launch it from your program with no input file, but with the "-"
>>> option in place of the input file. The you can feed it on the standard
>>> input with the scene description.
>> That does not work. POV-Ray cannot read scenes from std input because std
>> input is not random access capable.
>>
>> 	Thorsten
> 
> From the man page:
> 
>    Parsing options:
>        I<input_file_name> or Input_File_Name=file
>               Specifies the input file to use.  If the input file name is '-',
>               the scene description will be read from the standard
>               input.  The
> 
> Odd that it cuts off like that, but there you go.

The man page is simply outdated.

	Thorsten, POV-Team


Post a reply to this message

From: frfo
Subject: Re: Povray directly from C program
Date: 5 Jun 2007 17:30:37
Message: <4665d5fd@news.povray.org>

> EinarDogfin wrote:
>> Thorsten Froehlich <tho### [at] trfde> writes:
>>
>>> frfo wrote:
>>>> I would suggest to use megapov (command line version on windows).
>>>> You launch it from your program with no input file, but with the "-"
>>>> option in place of the input file. The you can feed it on the standard
>>>> input with the scene description.
>>> That does not work. POV-Ray cannot read scenes from std input because std
>>> input is not random access capable.
>>>
>>> 	Thorsten
>> From the man page:
>>
>>    Parsing options:
>>        I<input_file_name> or Input_File_Name=file
>>               Specifies the input file to use.  If the input file name is '-',
>>               the scene description will be read from the standard
>>               input.  The
>>
>> Odd that it cuts off like that, but there you go.
> 
> The man page is simply outdated.
> 
> 	Thorsten, POV-Team

It does work with simple scenes. It fails with scenes with macro.
I haven't experimented to find out the exact limit, but if the scene is 
generated it should be possible to use only basic SDL (no macro, no 
declare, ...). The parser would not need random acces and it would do 
the trick.

I have a small ongoing project using this hack, but I've not spent 
enough time on it to be able to be definitive on the subject.
Let me know if you try it.

BTW, Thorsten, please, don't remove this in the next version, even with 
strong limitations is can be usefull.


Frederic


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Povray directly from C program
Date: 5 Jun 2007 18:21:01
Message: <4665e1cd$1@news.povray.org>
frfo wrote:
> It does work with simple scenes. It fails with scenes with macro.

Yes, it will fail with any scene where POV-Ray has to move around in the
input file.

	Thorsten


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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