|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  | I want to create multiple images that differ only by one or two variables,
such as the width of one object and the value of a text string.
I was trying to find a way to do this by passing parameters to povray from a
batch file, but couldn't find a way to do it.
The animation feature allows external control of the Clock value, but it's
not suited for the purpose I need.
I thought of using an internal #while loop, but didn't see any way to output
an image file from inside the loop.
Right now the only way I can think of to do it is to write a tool that
creates multiple similar .pov files, one for each image I want to make, and
then run a batch file to invoke povray on all the created files.  Seems
clumsy though.
Any suggestions will be greatly appreciated.  I'm running POV-Ray 3.6 on
Debian Linux 3.1.
-Ted
 Post a reply to this message
 |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  | > I was trying to find a way to do this by passing parameters to povray from
a
> batch file, but couldn't find a way to do it.
3.1.2.5.1  Constant
"Declare=IDENTIFIER=FLOAT  Declares an identifier with a float value
You can now declare a constant in an INI file, and that constant will be
available to the scene. Since INI file statements may also be laced on the
command-line, you can therefore also declare on the command-line (though
there is no switch for it)."
See the docs for an example.
 - Slime
 [ http://www.slimeland.com/ ]
 Post a reply to this message
 |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  | ttread wrote:
> I want to create multiple images that differ only by one or two variables,
> such as the width of one object and the value of a text string.
> 
> I was trying to find a way to do this by passing parameters to povray from a
> batch file, but couldn't find a way to do it.
povray [options] Declare=identifier=value
> The animation feature allows external control of the Clock value, but it's
> not suited for the purpose I need.
Huh?  There are lost of sample scenes coming with POV-Ray that do 
exactly this.  For example
incdemo/i_internal.pov
incdemo/glasses/samp_demo.pov
incdemo/glasses/glass.pov
textures/patterns/crackle_form.pov
portfolio/*
Christoph
-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.tu-bs.de/~y0013390/ (Last updated 24 Jul. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/
 Post a reply to this message
 |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  | Thank you very much, that's exactly what I was looking for.
 Post a reply to this message
 |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  | Christoph Hormann <chr### [at] gmx de> wrote:
> ttread wrote:
> > I want to create multiple images that differ only by one or two variables,
> > such as the width of one object and the value of a text string.
> >
> > I was trying to find a way to do this by passing parameters to povray from a
> > batch file, but couldn't find a way to do it.
>
> povray [options] Declare=identifier=value
Yep, thanks, that's what I was looking for.
>
> > The animation feature allows external control of the Clock value, but it's
> > not suited for the purpose I need.
>
> Huh?  There are lost of sample scenes coming with POV-Ray that do
> exactly this.  For example
>
> incdemo/i_internal.pov
> incdemo/glasses/samp_demo.pov
> incdemo/glasses/glass.pov
> textures/patterns/crackle_form.pov
> portfolio/*
>
You are correct;  however, I thought there must be a better way. Post a reply to this message
 |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  | Ok, I have tried passing a string value through the command line using the
syntax:
Declare=TEXT_VAR="Foo"
This does not work because the value gets converted to a float type.
Apparently it's not possible to pass a string on the command line.
I guess I will use the animation clock value and test it against a case
statement to select different strings.
 Post a reply to this message
 |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  | Wasn't it ttread who wrote:
>
>I guess I will use the animation clock value and test it against a case
>statement to select different strings.
It would be easier to use frame_number to index an array of strings.
#declare Params = array[3] {"Foo","Bar","Baz"}
#declare MyParam = Params[frame_number-1];
Remember that frame_number starts at 1, but arrays number from 0.
-- 
Mike Williams
Gentleman of Leisure
Post a reply to this message
 |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  | Wasn't it ttread who wrote:
>I guess I will use the animation clock value and test it against a case
>statement to select different strings.
If you've got several parameters to set for each frame, you might
consider storing them in a data file, and reading them like this:
#fopen DATA "data.txt" read
#declare i=0;
#while (i < frame_number)
  #read (DATA, Text_var, Float_var, Vector_var)
  #declare i=i+1;
#end
The data.txt file would be formatted like this:
"Foo",  1.3,  <1.0,2.0,3.0>,
"Bar",  2.2,  <1.1,2.1,3.1>,
"Baz",  3.1,  <1.2,2.2,3.2>,
(Don't forget the commas on the ends of the lines)
-- 
Mike Williams
Gentleman of Leisure
 Post a reply to this message
 |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  | Mike Williams <nos### [at] econym demon  co  uk> wrote:
> It would be easier to use frame_number to index an array of strings.
Yes, thanks, I should have said frame_number
-Ted Post a reply to this message
 |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  |