POV-Ray : Newsgroups : povray.general : Help - Shelling out to the Operating system from Povray Server Time
4 Nov 2024 17:34:20 EST (-0500)
  Help - Shelling out to the Operating system from Povray (Message 1 to 8 of 8)  
From: wisher
Subject: Help - Shelling out to the Operating system from Povray
Date: 28 Nov 2003 00:40:01
Message: <web.3fc6de42308645416a00b1d70@news.povray.org>
Hello.
What I'm doing is rendering a high resolution, fairly realistic model of our
solar system.

I've been working with this planetarium modeler that Marius van der Spek
wrote for povray in '98. The modeler itself is very good, with the one
caveat that it's not 100% compatible with povray 3.5, which is unfortunate
because I can't recompile his app as I don't have his source code, just the
.....exe.
The modeler is available on  http://objects.povworld.org/
it's called planetarium or similar.

All that aside here's the issue :

I have a program called povplan.exe that I need to call after every frame,
and pass it the new time value as a parametre.

I'm doing this so that I can automatically increment his internal clock and
render an animation of a solar eclipse. Which I'd be more than happy to
share with everyone once I solve this.

So I'm using Pre_Frame_Command.
The doc on this command can be found here.
http://www.povray.org/documentation/view/130/

What I have working : I can call the program povplan.exe before each frame
is rendered.
What I don't follow how to do (from the docs on the planetarium) :
"PPTIME.INC returns two sets of variables :

time_string

and

new_yr
new_mo
new_dy
new_hr
new_mi
new_se

where the 'new' variables have the same format of the 'was' variables, and
time_string is a string in a format compatible with the command line
arguments
of the POVPLAN.EXE program.<b> You can invoke POVPLAN.EXE from within your
scene file using POV-Ray's Pre_Frame_Command and the string concatenation
function.  See the POV-Ray documentation, SAMPLE.INI and SAMPLE.POV for the
details.</b>

<i>This is the crux of the problem right here. Sample.INI and Sample.pov
don't contain useful info, and the docs don't really explain it either.</i>

Am I actually supposed to include the Pre_Frame_Command in what file?  The
Pov?  An INI?  Right now it's in the master.INI file.  Is that part of the
problem?







Once you have called the POVPLAN.EXE program with time_string as the command
line argument, you can create the command line argument for the next frame
by
doing the following :

#declare was_yr = new_yr
#declare was_mo = new_mo
#declare was_dy = new_dy
#declare was_hr = new_hr
#declare was_mi = new_mi
#declare was_se = new_se"

Like I said, I've just never worked with passing files strings, and I don't
know how to go about it exactly.
The docs on string in povray :

http://www.povray.org/documentation/view/141/

I'm not expecting much here; perhaps this just requires more knowledge of
the software than I've got, but I'm hoping that someone here has an idea.
It doesn't even have to be a good idea.

Another thing about povray is that the output is always a graphic, so a
debugger or something like cout>> would be so nice, but it's just not
available afaik.

By the by, Happy Thanksgiving.


Thanks


---
too many zigs


Post a reply to this message

From: Hughes, B 
Subject: Re: Help - Shelling out to the Operating system from Povray
Date: 28 Nov 2003 09:00:06
Message: <3fc754e6@news.povray.org>
"wisher" <nomail@nomail> wrote in message
news:web.3fc6de42308645416a00b1d70@news.povray.org...
>
> I have a program called povplan.exe that I need to call after every frame,
> and pass it the new time value as a parametre.
>
> I'm doing this so that I can automatically increment his internal clock
and
> render an animation of a solar eclipse. Which I'd be more than happy to
> share with everyone once I solve this.
>
> So I'm using Pre_Frame_Command.

Unfortunately, this isn't going to work for that. At least I don't believe
so. You can't pass command-line variables from within a scene file, or an
INI file either. Looks like it might have been an assumption made by the
author at the time of writing the Planetarium doc. If povplan.exe could
accept a text file that would be a different story, because that way you
could have POV write out the variables to a file and invoke them from there.
I don't see any way of going about this as is, since even writing a file
named as the variables, like:  yyyy mm dd hh mm ss.f  could not be told from
within the INI file to see it in a usable way. Well, it would be... only if
Pre_Frame_Command=povplan Variable were possible to say.

> What I don't follow how to do (from the docs on the planetarium) :
> "PPTIME.INC returns two sets of variables :
>
> time_string
>
> and
>
> new_yr
> new_mo
> new_dy
> new_hr
> new_mi
> new_se
>
> where the 'new' variables have the same format of the 'was' variables, and
> time_string is a string in a format compatible with the command line
> arguments
> of the POVPLAN.EXE program.<b> You can invoke POVPLAN.EXE from within your
> scene file using POV-Ray's Pre_Frame_Command and the string concatenation
> function.  See the POV-Ray documentation, SAMPLE.INI and SAMPLE.POV for
the
> details.</b>
>
> <i>This is the crux of the problem right here. Sample.INI and Sample.pov
> don't contain useful info, and the docs don't really explain it
either.</i>
>
> Am I actually supposed to include the Pre_Frame_Command in what file?  The
> Pov?  An INI?  Right now it's in the master.INI file.  Is that part of the
> problem?

INI file... but as I said, it won't accept variables from a scene file
directly. Only those kinds mentioned in the POV-Ray doc. I.e., file name of
the scene being rendered, image res., frame count. Other than just manually
entering the numbers after the executable.

> Once you have called the POVPLAN.EXE program with time_string as the
command
> line argument, you can create the command line argument for the next frame
> by doing the following :
>
> #declare was_yr = new_yr
> #declare was_mo = new_mo
> #declare was_dy = new_dy
> #declare was_hr = new_hr
> #declare was_mi = new_mi
> #declare was_se = new_se"
>
> Like I said, I've just never worked with passing files strings, and I
don't
> know how to go about it exactly.

Been a very long time since I saw the Planetarium. I got it to render here
by putting a #version 3.0 directive in and commenting out the 'halo' which
was used for the Earth's atmosphere. Those variables mentioned above needed
to be declared initially with date/time numbers before I could start using
the scene file.

My best idea for a solution to this is impossible simply because doing a
#write from within the POV or INC can't be seen by povplan.exe in a usable
manner. Again, where povplan fails here, it can't take a file as input;
otherwise it'd be possible to do.

> Another thing about povray is that the output is always a graphic, so a
> debugger or something like cout>> would be so nice, but it's just not
> available afaik.

There is... in a way. The message stream output tells all it can. :-)

> By the by, Happy Thanksgiving.

And a Happy post-Thanksgiving to you as well. And if lucky enough maybe
somebody else will prove my observations concerning this as being at least
partially incorrect.

Bob H.


Post a reply to this message

From: Stephen McAvoy
Subject: Re: Help - Shelling out to the Operating system from Povray
Date: 28 Nov 2003 14:19:43
Message: <0u7fsvcoa69p7qk3f15ukg8e7883sk980c@4ax.com>
On Fri, 28 Nov 2003 08:00:00 -0600, "Hughes, B." <omn### [at] charternet> wrote:

>Unfortunately, this isn't going to work for that. At least I don't believe
>so. You can't pass command-line variables from within a scene file, or an
>INI file either.

This might seem daft but can't you write a batch file that calls povplan.exe
with the required variables after the exe? 

#fopen RunProg " RunProg.bat " write

#write(RunProg, "povplan.exe" , [Variable1]...)

#fclose RunProg



Pre_Frame_Command = RunProg.bat

Regards
        Stephen


Post a reply to this message

From: Hughes, B 
Subject: Re: Help - Shelling out to the Operating system from Povray
Date: 29 Nov 2003 15:17:33
Message: <3fc8fedd$1@news.povray.org>
Would be perfect maybe, Stephen, if it weren't for the fact I don't know how
to actually get the POV Planetarium 009 to animate.  :-)

I tried your method like so:

        #declare was_yr  = 2003;
        #declare was_mo  = 11;
        #declare was_dy  = 29;
        #declare was_hr  = 12;
        #declare was_mi  = 0;
        #declare was_se  = 0;
        #declare secs_incr = 1/15;

#fopen RunProg "plantime.bat" write

#write(RunProg, "povplan.exe " , was_yr," ", was_mo," ", was_dy," ",
was_hr," ", was_mi," ", was_se)

#fclose RunProg

#version 3.0

Goes at the head of the Sample.pov file and renders okay, except that I
haven't animated this utility before; not that I can remember anyway. I'm
not thinking clearly enough ATM to be able to get a series of frames done.

The Sample.ini has this added:

Pre_Frame_Command=cmd /c plantime.bat

If using Windows 95/98 it would be the word command instead of cmd. The /c
switch closes each DOS window after execution of the batch file. Oh, and
about that Sample.ini file... it has a +O switch telling the output to be
named sample.ini, obviously a mistake and should be sample.tga instead.

Bob H.


Post a reply to this message

From: wisher
Subject: Re: Help - Shelling out to the Operating system from Povray
Date: 29 Nov 2003 15:30:01
Message: <web.3fc9010990726ba76a00b1d70@news.povray.org>
Thanks very much for all the help!  I really wasn't expecting much; first
time here.
What I ended up doing was coding a simple C++ program to output to a .bat
file a series of calls to pvengine and povplan, and ran povray from the
command line.
It looks alright; I think I'm eventually going to write my own solar system
modeler.  Really a good bit of fun.
---
too many zigs


Post a reply to this message

From: wisher
Subject: Re: Help - Shelling out to the Operating system from Povray
Date: 29 Nov 2003 16:05:01
Message: <web.3fc909f590726ba76a00b1d70@news.povray.org>
here's an early animation; I just started using povray last week or so.
if anyone is interested, I can post the source for the c++ file to create
the .bat
http://s90459655.onlinehome.us
---
too many zigs


Post a reply to this message

From: Stephen McAvoy
Subject: Re: Help - Shelling out to the Operating system from Povray
Date: 1 Dec 2003 09:50:55
Message: <calmsvgd0rd6hbo9o74u3iqpa5b9tipl7u@4ax.com>
On Sat, 29 Nov 2003 14:17:28 -0600, "Hughes, B." <omn### [at] charternet> wrote:

>Would be perfect maybe, Stephen, if it weren't for the fact I don't know how
>to actually get the POV Planetarium 009 to animate.  :-)

Nor do I, it was just a thought. 

Regards
        Stephen


Post a reply to this message

From: Sasathorn Phaspinyo
Subject: Re: Help - Shelling out to the Operating system from Povray
Date: 25 Dec 2003 20:58:30
Message: <3feb95c6@news.povray.org>
"wisher" <nomail@nomail> wrote in message
news:web.3fc909f590726ba76a00b1d70@news.povray.org...
> here's an early animation; I just started using povray last week or so.
> if anyone is interested, I can post the source for the c++ file to create
> the .bat
> http://s90459655.onlinehome.us
> ---
> too many zigs
>
>


Post a reply to this message

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