POV-Ray : Newsgroups : povray.programming : Executing POV from Visual Basic Server Time
30 Dec 2024 10:50:44 EST (-0500)
  Executing POV from Visual Basic (Message 1 to 8 of 8)  
From: Orionis
Subject: Executing POV from Visual Basic
Date: 26 Jun 2009 13:00:00
Message: <web.4a44fdd48ff8f8935430b1600@news.povray.org>
Hello,
I am brand new to the forum and to POV too (still studying a lot).
My question is possibly dumb (or maybe, was raised hundreds of time, but I did
not find any evidence), so please forgive me.

My goal is to write a VB6 program (yes, VB6, not NET !) to draw panels for
electronic device; a small CAD...sigh

Right now, I create a text file from VB with the panel's element description,
then a run POV to render the image which is loaded and presented in a VB6
picturebox.

I wonder if there is any way to have VB6 call directly POV (a sort of API) and
let POV draw the rendering into a supplied window.

Ideally, I should call something like this:

call POV_Render ('filename.pov', myPictureHandle, [VB6 process ID],
[resolution/AA])

I accept any comment, thanks


Post a reply to this message

From: clipka
Subject: Re: Executing POV from Visual Basic
Date: 26 Jun 2009 14:25:00
Message: <web.4a45124fe18746bda745f7570@news.povray.org>
"Orionis" <gia### [at] boxideeit> wrote:
> Ideally, I should call something like this:
>
> call POV_Render ('filename.pov', myPictureHandle, [VB6 process ID],
> [resolution/AA])
>
> I accept any comment, thanks

POV-Ray itself does not come with a VBA-compatible API (nor do I know of any 3rd
party "glue-code").

You will have to make a call to the Windows API to run the povray binary,
passing the .pov filename and the name for a temporary output file as command
line parameters; same for resolution and AA options and the like. You should
also specify the "/EXIT" command line parameter, and make sure POV-Ray is
configured to allow for multiple instances. You'll then have to wait for
POV-Ray to terminate, and then read in the temporary output file.

I don't expect anyone to ever come up with a closer integration of POV-Ray 3.6
into VBA (other than maybe writing a VBA wrapper to do the above). Maybe the
more modular architecture of POV-Ray 3.7 will lead to development of more
elegant APIs for some frameworks such as COM, ActiveX or .NET, which could act
as an alternative front-end from POV-Ray's perspective.


Post a reply to this message

From: Orionis
Subject: Re: Executing POV from Visual Basic
Date: 29 Jun 2009 06:25:00
Message: <web.4a4895c5e18746bd5430b1600@news.povray.org>
> You will have to make a call to the Windows API to run the povray binary,
> passing the .pov filename and the name for a temporary output file as command
> line parameters; same for resolution and AA options and the like. You should
> also specify the "/EXIT" command line parameter, and make sure POV-Ray is
> configured to allow for multiple instances. You'll then have to wait for
> POV-Ray to terminate, and then read in the temporary output file.

Thanks for your prompt answer.
I will study the command line format (and the Windows Shell) to see if can do
that.
I guess it is not so easy.


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Executing POV from Visual Basic
Date: 29 Jun 2009 17:33:03
Message: <4a49330f$1@news.povray.org>
clipka wrote:

> Maybe the more modular architecture of POV-Ray 3.7 will lead to
> development of more elegant APIs for some frameworks

I think the main problem was that the license does not
(yet?) allow to integrate POV-Ray as a library.


Post a reply to this message

From: clipka
Subject: Re: Executing POV from Visual Basic
Date: 1 Jul 2009 13:15:01
Message: <web.4a4b996ee18746bd5def94260@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> > Maybe the more modular architecture of POV-Ray 3.7 will lead to
> > development of more elegant APIs for some frameworks
>
> I think the main problem was that the license does not
> (yet?) allow to integrate POV-Ray as a library.

It doesn't prohibit writing a customized version that provides an API in
*addition* to the command-line and GUI interfaces.


Post a reply to this message

From: Orionis
Subject: Re: Executing POV from Visual Basic
Date: 6 Jul 2009 05:30:00
Message: <web.4a51c3d9e18746bd5430b1600@news.povray.org>
"clipka" <nomail@nomail> wrote:
> other than maybe writing a VBA wrapper to do the above

Thanks sirs for your replies.
Surely a wrapper would be potentially useful; unfortunately it is out of my
capabilities.

I really love POV, it produces wonderfull thing, but it is too complicated for
me.
I only need, and use it, to do very simple scenes, possibly using 1% of its
functionalities.

At the moment I (partially) solved my problem with a 'stupid' and really ugly
solution: from VB I create a new world; POV (manually started) loads and
renders this world; VB waits and looks for the new bitmapped file to be
produced and when the 'modified date' is changed loads then image into a
picturebox.

This waiting for new briliant ideas to come :-)

Ciao


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Executing POV from Visual Basic
Date: 5 Aug 2009 17:02:58
Message: <4a79f381@news.povray.org>
clipka wrote:
> Christian Froeschlin <chr### [at] chrfrde> wrote:
>> > Maybe the more modular architecture of POV-Ray 3.7 will lead to
>> > development of more elegant APIs for some frameworks
>>
>> I think the main problem was that the license does not
>> (yet?) allow to integrate POV-Ray as a library.
> 
> It doesn't prohibit writing a customized version that provides an API in
> *addition* to the command-line and GUI interfaces.

"Neither the Licensed Version nor any Modified Version may be linked into
any other software package either at compile-time using (for example) an
object code linker nor at run-time as (for example) a DLL"


Post a reply to this message

From: clipka
Subject: Re: Executing POV from Visual Basic
Date: 5 Aug 2009 17:56:56
Message: <4a7a0028$1@news.povray.org>
Nicolas Alvarez schrieb:
> clipka wrote:
>   
>> Christian Froeschlin <chr### [at] chrfrde> wrote:
>>     
>>>> Maybe the more modular architecture of POV-Ray 3.7 will lead to
>>>> development of more elegant APIs for some frameworks
>>>>         
>>> I think the main problem was that the license does not
>>> (yet?) allow to integrate POV-Ray as a library.
>>>       
>> It doesn't prohibit writing a customized version that provides an API in
>> *addition* to the command-line and GUI interfaces.
>>     
>
> "Neither the Licensed Version nor any Modified Version may be linked into
> any other software package either at compile-time using (for example) an
> object code linker nor at run-time as (for example) a DLL

This *does* indeed prohibit distributing such a Modified Version as part 
of a *software package*; however, to my understanding it does *not* 
prohibit creating a Modified Version that just adds an API in order to 
empower end-users to drive it from VB.


Post a reply to this message

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