POV-Ray : Newsgroups : povray.general : Using povray at the command line in windows Server Time
4 Nov 2024 21:23:47 EST (-0500)
  Using povray at the command line in windows (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: darnold
Subject: Using povray at the command line in windows
Date: 3 May 2008 19:00:00
Message: <web.481cecaf909686ded1dda480@news.povray.org>
All,

I'd like to execute povray from the command line, but that does not appear to be
an option with the current windows version.

What I want to do is produce a sequence of images, each of which depends upon
two parameters, phi and theta. The values of phi and theta are generated in
Matlab and saved to a text file.

A former student of mine wrote a script on a unix box to accomplish the task:





cat defs.ini | sed s / var1 /$THETA/ | sed s / var2 /$PHI/>newdefs.ini ;
povray -W640 -H480 +Oanim-$TIME.png anim.pov ;
done ;

But I don't seem to have access to the "povray" command in a DOS box to mimic
this approach.

Is there a suggested alternative?

Thanks.

David.


Post a reply to this message

From: andrel
Subject: Re: Using povray at the command line in windows
Date: 3 May 2008 19:27:22
Message: <481CF504.2080409@hotmail.com>
darnold wrote:
> All,
> 
> I'd like to execute povray from the command line, but that does not appear to be
> an option with the current windows version.
> 
> What I want to do is produce a sequence of images, each of which depends upon
> two parameters, phi and theta. The values of phi and theta are generated in
> Matlab and saved to a text file.
> 
> A former student of mine wrote a script on a unix box to accomplish the task:
> 




> cat defs.ini | sed s / var1 /$THETA/ | sed s / var2 /$PHI/>newdefs.ini ;
> povray -W640 -H480 +Oanim-$TIME.png anim.pov ;
> done ;
> 
> But I don't seem to have access to the "povray" command in a DOS box to mimic
> this approach.
> 
> Is there a suggested alternative?
> 
You can call povray directly from matlab. The executable is called 
pvengine.exe .

The key lines in my povray.m files are:

function povray(povfile,varargin)
[parsing name-value pairs in varargin]
POVpath='c:\program files\pov-ray for windows v3.6';
POVpath='c:\progra~1\pov-ra~1.6'; %DOS version without spaces
s=sprintf('!"%s\\bin\\pvengine.exe" +I%s',POVpath,povfile);

and then after possibly adding /EXIT (and other parameters) to the 
string I call

eval(s);

I hope that helps. I could also give you my povray.m but it depends on 
some other script to parse the name-value pairs. And I don't want to 
write documentation for that (it is fully documented but not in the 
matlab script itself)


Post a reply to this message

From: Alain
Subject: Re: Using povray at the command line in windows
Date: 4 May 2008 11:08:40
Message: <481dd178$1@news.povray.org>
andrel nous illumina en ce 2008/05/03 19:28 -->
> darnold wrote:
>> All,
>>
>> I'd like to execute povray from the command line, but that does not 
>> appear to be
>> an option with the current windows version.
>>
>> What I want to do is produce a sequence of images, each of which 
>> depends upon
>> two parameters, phi and theta. The values of phi and theta are 
>> generated in
>> Matlab and saved to a text file.
>>
>> A former student of mine wrote a script on a unix box to accomplish 
>> the task:
>>
>> f o r a in ‘ cat odeoutput.txt | sed ”s/ /_/g” ‘ ; do
>> TIME=‘echo $a | cut -d'_’-f1 ‘ ;
>> THETA=‘echo $a | cut -d ’_’ -f2 ‘ ;
>> PHI=‘echo $a | cut -d ’_’ -f3 ‘ ;
>> cat defs.ini | sed s / var1 /$THETA/ | sed s / var2 /$PHI/>newdefs.ini ;
>> povray -W640 -H480 +Oanim-$TIME.png anim.pov ;
>> done ;
>>
>> But I don't seem to have access to the "povray" command in a DOS box 
>> to mimic
>> this approach.
>>
>> Is there a suggested alternative?
>>
> You can call povray directly from matlab. The executable is called 
> pvengine.exe .
> 
> The key lines in my povray.m files are:
> 
> function povray(povfile,varargin)
> [parsing name-value pairs in varargin]
> POVpath='c:\program files\pov-ray for windows v3.6';
> POVpath='c:\progra~1\pov-ra~1.6'; %DOS version without spaces
> s=sprintf('!"%s\\bin\\pvengine.exe" +I%s',POVpath,povfile);
> 
> and then after possibly adding /EXIT (and other parameters) to the 
> string I call
> 
> eval(s);
> 
> I hope that helps. I could also give you my povray.m but it depends on 
> some other script to parse the name-value pairs. And I don't want to 
> write documentation for that (it is fully documented but not in the 
> matlab script itself)
Don't use "/exit" if you want to render more than one image. If you use that, 
you'll force POV-Ray to get started for each image, then unloaded, and you'll 
get the splash every time.

-- 
Alain
-------------------------------------------------
History, in general, only informs us of what bad government is.
Thomas Jefferson


Post a reply to this message

From: andrel
Subject: Re: Using povray at the command line in windows
Date: 4 May 2008 12:25:46
Message: <481DE3B4.40209@hotmail.com>
Alain wrote:
> andrel nous illumina en ce 2008/05/03 19:28 -->
>> darnold wrote:
>>> All,
>>>
>>> I'd like to execute povray from the command line, but that does not 
>>> appear to be
>>> an option with the current windows version.
>>>
>>> What I want to do is produce a sequence of images, each of which 
>>> depends upon
>>> two parameters, phi and theta. The values of phi and theta are 
>>> generated in
>>> Matlab and saved to a text file.
>>>
>>> A former student of mine wrote a script on a unix box to accomplish 
>>> the task:
>>>
>>> f o r a in ‘ cat odeoutput.txt | sed ”s/ /_/g” ‘ ; do
>>> TIME=‘echo $a | cut -d'_’-f1 ‘ ;
>>> THETA=‘echo $a | cut -d ’_’ -f2 ‘ ;
>>> PHI=‘echo $a | cut -d ’_’ -f3 ‘ ;
>>> cat defs.ini | sed s / var1 /$THETA/ | sed s / var2 /$PHI/>newdefs.ini ;
>>> povray -W640 -H480 +Oanim-$TIME.png anim.pov ;
>>> done ;
>>>
>>> But I don't seem to have access to the "povray" command in a DOS box 
>>> to mimic
>>> this approach.
>>>
>>> Is there a suggested alternative?
>>>
>> You can call povray directly from matlab. The executable is called 
>> pvengine.exe .
>>
>> The key lines in my povray.m files are:
>>
>> function povray(povfile,varargin)
>> [parsing name-value pairs in varargin]
>> POVpath='c:\program files\pov-ray for windows v3.6';
>> POVpath='c:\progra~1\pov-ra~1.6'; %DOS version without spaces
>> s=sprintf('!"%s\\bin\\pvengine.exe" +I%s',POVpath,povfile);
>>
>> and then after possibly adding /EXIT (and other parameters) to the 
>> string I call
>>
>> eval(s);
>>
>> I hope that helps. I could also give you my povray.m but it depends on 
>> some other script to parse the name-value pairs. And I don't want to 
>> write documentation for that (it is fully documented but not in the 
>> matlab script itself)
> Don't use "/exit" if you want to render more than one image. If you use 
> that, you'll force POV-Ray to get started for each image, then unloaded, 
> and you'll get the splash every time.
> 
True but the script continues only after pov is closed. If you don't use 
/exit you have to manually close pov to continue in matlab. That is 
generally not what you want. Unless there is a trick to run the system 
command in another thread.
If you don't like the splash you can always use megapov.

In this case I think I would write implement it as an animation and 
write all time theta and phi values to a file at once or perhaps one 
include file for every framenr and use string concatenation to get the 
right parameter file.


Post a reply to this message

From: andrel
Subject: Re: Using povray at the command line in windows
Date: 4 May 2008 12:38:44
Message: <481DE6BF.6070907@hotmail.com>
andrel wrote:
> Unless there is a trick to run the system command in another thread.
hmm, yes there is. Just add a '&' at the end. I might have guessed :(


Post a reply to this message

From: William Tracy
Subject: Re: Using povray at the command line in windows
Date: 5 May 2008 01:58:04
Message: <481ea1ec$1@news.povray.org>
andrel wrote:
> hmm, yes there is. Just add a '&' at the end. I might have guessed :(

Does that work in DOS/Windows?

-- 
William Tracy
afi### [at] gmailcom -- wtr### [at] calpolyedu

Don't code to live; live to code!


Post a reply to this message

From: Darren New
Subject: Re: Using povray at the command line in windows
Date: 5 May 2008 12:07:30
Message: <481f30c2$1@news.povray.org>
William Tracy wrote:
> Does that work in DOS/Windows?

It depends on whether "DOS/Windows" means "DOS" or "Windows." The two 
haven't been related in close to a decade.

It works under any version of Windows you're likely to be running these 
days.

-- 
   Darren New / San Diego, CA, USA (PST)
     "That's pretty. Where's that?"
          "It's the Age of Channelwood."
     "We should go there on vacation some time."


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Using povray at the command line in windows
Date: 5 May 2008 19:55:45
Message: <481f9e81@news.povray.org>
Darren New wrote:
> It works under any version of Windows you're likely to be running these
> days.

Not really.

& in a Windows prompt has a different meaning. a & b is like Unix's "a; b;"
(runs both commands, one after the other) and a && b is the same as in Unix
(runs both commands, but if a fails then b isn't run).

I have a port of Unix's "env" command that, due to a *bug*, returns
immediately and leaves the program running. I abuse that to run stuff in
the background on Windows. Either that or I start cygwin :)


Post a reply to this message

From: William Tracy
Subject: Re: Using povray at the command line in windows
Date: 5 May 2008 20:25:50
Message: <481fa58e@news.povray.org>
Duh, DOS wasn't actually multitasking, so it wouldn't work there.

Nicolas Alvarez wrote:
> & in a Windows prompt has a different meaning. a & b is like Unix's "a; b;"
> (runs both commands, one after the other) and a && b is the same as in Unix
> (runs both commands, but if a fails then b isn't run).

Now that makes me curious what Windows would do if you entered a command 
with nothing after the ampersand. I may need to track down a Windows 
system and play with it. :-)

>  Either that or I start cygwin :)

I've reached the point where I can't be productive in Windows without 
Cygwin. :-P

-- 
William Tracy
afi### [at] gmailcom -- wtr### [at] calpolyedu

    It occurred to him that now he was going to be not only the first 
man on Mars, but the first detective. He grinned at the thought, and the 
last action of the omegendorph set his nerves aglow.
     -- Kim Stanley Robinson, _Red Mars_


Post a reply to this message

From: Darren New
Subject: Re: Using povray at the command line in windows
Date: 5 May 2008 20:29:00
Message: <481fa64c$1@news.povray.org>
Nicolas Alvarez wrote:
> Darren New wrote:
>> It works under any version of Windows you're likely to be running these
>> days.
> 
> Not really.

Whoops. Sorry. Don't know where my brain was. Too much Linux or Tcl 
lately. :-)

Put "start" on the front to get it running in the background.

-- 
   Darren New / San Diego, CA, USA (PST)
     "That's pretty. Where's that?"
          "It's the Age of Channelwood."
     "We should go there on vacation some time."


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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