POV-Ray : Newsgroups : povray.general : Using povray at the command line in windows : Re: Using povray at the command line in windows Server Time
30 Jul 2024 22:22:25 EDT (-0400)
  Re: Using povray at the command line in windows  
From: andrel
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

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