POV-Ray : Newsgroups : povray.animations : using an animation as an image map : Re: using an animation as an image map Server Time
28 Jul 2024 20:30:34 EDT (-0400)
  Re: using an animation as an image map  
From: Chris Colefax
Date: 22 Aug 1998 01:32:18
Message: <35DE4C91.B6B60472@geocities.com>
me wrote:
> 
> I want to actually use an animation as a height field, but the idea is
> basically th same:
> 
> clock goes from 0 to 1
> animation goes from fram 1 to 15
> mapped_animation goes from frame 1 to 15
> 
> #declare current_frame=15*clock     //should be an integer...
> #declare file="D:\images\fram" + current_frame + ".tga"
> height field { file    <<height field stuff>> }
> 
> but, because current_frame is an integer, it can not be concatenated (added)
> with the strings "D:\images\fram"  and  ".tga,"  so, I can not end up with
> the string "d:\images\povray\fram15.tga"
> 
> The question is.....  (drum roll please)   how do I convert the integer
> current_frame to a string so that I can concatenate it?  I have tried the
> system, but using current_frame="15"  to see that strings do concatenate the
> way I want, and it worked fine.  But, in order to automate it as an
> animation, I need 15*clock, and that returns a number, not a string!!!
> can anybody help me with this?   Is this stated explicitly in the manual?

If you have the frame files as you described it should be as simple
as:

  height_field {tga concat("D:\images\fram", str(clock*14 + 1, -2, 0), ".tga") ...

This should give you "fram01.tga" to "fram15.tga", as desired.  You
don't mention where the frame images are coming from - if they are
generated using POV-Ray itself, you can actually automate the process
so that POV-Ray will render the current height_field image before using
it as it renders the main image, eg. if you have Map.pov:

   plane {z, 1 pigment {... phase clock} finish {ambient 1}}
   camera {up y right x}
   global_settings {hf_gray_16 true}

and you have Anim.pov:

   height_field {tga "Map.tga" ....

Now, create a simple INI file containing something like:

   Pre_Frame_Command=POVRAY +iMap.pov +w300 +h300 +k&k -p -d +v

The exact command line details will depend on your system, but as
long as you remember to turn of pausing (-p) you should then be able
to render Anim.pov with the INI file, and you will have an animated
3-dimensional pigment - I've just tried it with a simple bozo, and
the results can be very interesting...


Post a reply to this message

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