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:23:28 EDT (-0400)
  Re: Using povray at the command line in windows  
From: Alain
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

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