POV-Ray : Newsgroups : povray.animations : height_field animation Server Time
23 Nov 2024 12:31:27 EST (-0500)
  height_field animation (Message 1 to 3 of 3)  
From: BentLarsen
Subject: height_field animation
Date: 19 Jun 2008 11:35:01
Message: <web.485a7b8752ee3a6c70f2ad620@news.povray.org>
Hi all,

I would like to animat a height-field, like an erupting surface or water.
I have managed to get the static height-field.

height_field{png  "heightField_1.png"  smooth
             texture{
                pigment{
                        image_map{
                                  png "teture.png"
                                 }
                       rotate x*90 // lay X-Y image map down onto X-Z height
                       }
                    }
             }

But I dont know how to tell pov-ray to loop
over 300 height-fields;
with every *.png beeing a single frame: heightField_1.png ...
heightField_300.png


Do I have to code a fileName-variable like:
 #while (Count < 300)
    #declare fileName=concat("heightField_", str(A,1,1), ".png")
    #declare Count=Count+1;
but how to tell pov-ray to render automatically and save the frames?

Or is there an easy way by using the clock variable?

thanx in advance!!!
Bent


Post a reply to this message

From: Stephen
Subject: Re: height_field animation
Date: 19 Jun 2008 12:41:40
Message: <u13l54lpbfs2iss4ipopprud618lcfolr5@4ax.com>
On Thu, 19 Jun 2008 11:30:15 EDT, "BentLarsen" <nomail@nomail> wrote:

>
>Or is there an easy way by using the clock variable?

Hi Bent,
You need to have your image maps numbered sequentially, tied to the
frame numbers of your animation. Then use frame_number, something like
(Note it is not tested) 


height_field{png  "heightField_1.png"  smooth
             texture{
                pigment{
                        image_map{
                                  png  concat("teture",
str(frame_number,-1,0),".png")
                                 }
                       rotate x*90 // lay X-Y image map down onto X-Z
height
                       }
                    }
             }

You should read the help 3.2.1.7.3  String Functions
To get the correct values for the string padding. 
Also for fault finding add a #debug statement like (Not Tested)

#debug concat("frame_number = ",frame_number, "/t", "Image =
",str("teture", str(frame_number,-1,0),".png"), "/n")

Read 3.2.2.7.1  Text Message Streams

-- 

Regards
     Stephen


Post a reply to this message

From: Chris B
Subject: Re: height_field animation
Date: 19 Jun 2008 14:25:56
Message: <485aa4b4@news.povray.org>
"BentLarsen" <nomail@nomail> wrote in message 
news:web.485a7b8752ee3a6c70f2ad620@news.povray.org...
> Hi all,
>
> I would like to animat a height-field, like an erupting surface or water.
> I have managed to get the static height-field.
>
>... snip ...
>
> But I dont know how to tell pov-ray to loop
> over 300 height-fields;
> with every *.png beeing a single frame: heightField_1.png ...
> heightField_300.png
>
>
> Do I have to code a fileName-variable like:
> #while (Count < 300)
>    #declare fileName=concat("heightField_", str(A,1,1), ".png")
>    #declare Count=Count+1;
> but how to tell pov-ray to render automatically and save the frames?
>

To animate you need to specify animation options either on the command-line 
or in an 'ini' file. In the Windows POV-Ray editor you can specify 
command-line options in the input field next to the screen resolution 
pull-down at top-left.

I usually use +kfi1 +kff100 in the command-line input field. These will do 
the same as the 'ini' file options Initial_Frame=1 and Final_Frame=100. The 
POV-Ray scene file will render 100 times and will append the frame number to 
the name of the image file generated. If your scene file is called 'MyScene' 
and you're generating 'bmp' files then, by default, the first image file 
generated will be called 'MyScene001.bmp' etc.

You don't need the #while loop within the scene file.

Within your scene you can then use the frame_number variable to control the 
name of the heightfield input file that you want to use and potentially also 
the texture file as Stephen described. I think you'll probably want 
str(frame_number,-3,0) which would give you 3 digits padded on the left with 
zeros.

Regards,
Chris B.


Post a reply to this message

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