POV-Ray : Newsgroups : povray.newusers : Changing parameters across runs Server Time
28 Jul 2024 16:32:49 EDT (-0400)
  Changing parameters across runs (Message 1 to 5 of 5)  
From: Numsgil
Subject: Changing parameters across runs
Date: 8 Nov 2007 00:25:00
Message: <web.47329d00a9b2848111481b6d0@news.povray.org>
I have various "planet" textures that I'm trying to pre-render animations for
for a game.  I've figured out a simple script for rendering a texture that
looks like this:

#include "colors.inc"
#declare TextureName = "Planets\\Terran01.png"

camera
{
    right x //Maintain square aspect ratio
    location <0, 0, 3>
    look_at <0,0,0>
}


sphere
{
    <0,0,0> 1
    texture
    {
        pigment
        {
            image_map
            {
                png TextureName
                map_type 1  // Esfera
            }
        }
    }

    rotate <0, -clock 0>  //Rotate so that the sun rises in the west
    finish { ambient 1 }
}
////////////////////////////////////////////////////////////

And the ini that looks like this:

; POV-Ray animation ini file
+ua ;Transparent background
Antialias=On
Antialias_Threshold=0.3
Antialias_Depth=2

Width=256
Height=256

Input_File_Name=Planet.pov
Output_File_Type = N
Output_File_Name = AnimatedPlanet\Planet

Initial_Frame=1
Final_Frame=36 ; 36 frames
Initial_Clock=0
Final_Clock=360

Cyclic_Animation=on
Pause_when_Done=off
;---------------------------------------------

What I'm trying to do now is change the texture being used so I can create a
batch file.  Ideally, I'd like something like this to work:

povray MyIni.ini TextureA.png
povray MyIni.ini TextureB.png
povray MyIni.ini TextureC.png
povray MyIni.ini TextureD.png
povray MyIni.ini TextureE.png

So I could pass parameters in to my ini, and have it change parameters in the
..pov file.  However, if there's a way to do this, I don't see it.  Can anyone
point me in the right direction?


Post a reply to this message

From: Chris B
Subject: Re: Changing parameters across runs
Date: 8 Nov 2007 13:01:08
Message: <47334ee4@news.povray.org>
"Numsgil" <Num### [at] yahoocom> wrote in message 
news:web.47329d00a9b2848111481b6d0@news.povray.org...
>I have various "planet" textures that I'm trying to pre-render animations 
>for
> for a game.  I've figured out a simple script for rendering a texture that
> looks like this:
>
> #include "colors.inc"
> #declare TextureName = "Planets\\Terran01.png"
>
> camera
> {
>    right x //Maintain square aspect ratio
>    location <0, 0, 3>
>    look_at <0,0,0>
> }
>
>
> sphere
> {
>    <0,0,0> 1
>    texture
>    {
>        pigment
>        {
>            image_map
>            {
>                png TextureName
>                map_type 1  // Esfera
>            }
>        }
>    }
>
>    rotate <0, -clock 0>  //Rotate so that the sun rises in the west
>    finish { ambient 1 }
> }
> ////////////////////////////////////////////////////////////
>
> And the ini that looks like this:
>
> ; POV-Ray animation ini file
> +ua ;Transparent background
> Antialias=On
> Antialias_Threshold=0.3
> Antialias_Depth=2
>
> Width=256
> Height=256
>
> Input_File_Name=Planet.pov
> Output_File_Type = N
> Output_File_Name = AnimatedPlanet\Planet
>
> Initial_Frame=1
> Final_Frame=36 ; 36 frames
> Initial_Clock=0
> Final_Clock=360
>
> Cyclic_Animation=on
> Pause_when_Done=off
> ;---------------------------------------------
>
> What I'm trying to do now is change the texture being used so I can create 
> a
> batch file.  Ideally, I'd like something like this to work:
>
> povray MyIni.ini TextureA.png
> povray MyIni.ini TextureB.png
> povray MyIni.ini TextureC.png
> povray MyIni.ini TextureD.png
> povray MyIni.ini TextureE.png
>
> So I could pass parameters in to my ini, and have it change parameters in 
> the
> ..pov file.  However, if there's a way to do this, I don't see it.  Can 
> anyone
> point me in the right direction?
>
>

Hi,

So far as I know you can't do quite what you've asked for, but you can 
probably get fairly close. If you take a look at the 'declare' 'ini-option' 
in the help you'll see that it allows you to declare a float variable which 
will be available to your scene file (not the ini file) e.g. 
'declare=TextureIndex=5'.

You can define an array within the scene file to hold the list of textures 
and index it using the variable that you use on the command-line call. For 
example #declare MyTexture[TextureIndex] = "TextureA.png";  You'd need to 
change the output file name on the command line from your script rather than 
in the ini file so that each successive call doesn't overwrite the same set 
of image files.

If you're running under Windows you may have a problem suppressing the 
startup screen - I vaguely remember people discussing such problems in the 
past.

I hope that helps

Regards,
Chris B.


Post a reply to this message

From: Numsgil
Subject: Re: Changing parameters across runs
Date: 9 Nov 2007 01:30:01
Message: <web.4733fd86c7cd3aaf11481b6d0@news.povray.org>
Ah, I think I see.  Not the greatest solution, but I think it'll do.  Thanks.


Post a reply to this message

From: kurtz le pirate
Subject: Re: Changing parameters across runs
Date: 11 Nov 2007 11:17:09
Message: <kurtzlepirate-81B91B.17170411112007@news.povray.org>
In article <web.47329d00a9b2848111481b6d0@news.povray.org>,
 "Numsgil" <Num### [at] yahoocom> wrote:

> What I'm trying to do now is change the texture being used so I can create a
> batch file.  Ideally, I'd like something like this to work:
> 
> povray MyIni.ini TextureA.png
> povray MyIni.ini TextureB.png
> povray MyIni.ini TextureC.png
> povray MyIni.ini TextureD.png
> povray MyIni.ini TextureE.png
> 
> So I could pass parameters in to my ini, and have it change parameters in the
> ..pov file.  However, if there's a way to do this, I don't see it.  Can anyone
> point me in the right direction?


just use an array of png files :
  #declare textureArry[5] {"TextureA.png","TextureB.png",... }

then : 

texture {
  pigment {
    image_map {
      png textureArry[frame_number]
      ...



-- 
klp


Post a reply to this message

From: Daryl
Subject: Re: Changing parameters across runs
Date: 5 Dec 2007 20:30:00
Message: <web.47575015c7cd3aafa0d81c6b0@news.povray.org>
"Numsgil" <Num### [at] yahoocom> wrote:
> Ah, I think I see.  Not the greatest solution, but I think it'll do.  Thanks.

I'm interested in this kind of problem in a more generic sense.   I've posted
a video showing a different kind of interaction with parameters in POV-Ray.

http://www.youtube.com/watch?v=KOJFM-FOJVg

Could this be useful to you?

Best regards,
Daryl


Post a reply to this message

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