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:17:36 EDT (-0400)
  Re: Using povray at the command line in windows  
From: andrel
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

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