POV-Ray : Newsgroups : povray.animations : using an animation as an image map Server Time
28 Jul 2024 18:26:18 EDT (-0400)
  using an animation as an image map (Message 1 to 5 of 5)  
From: me
Subject: using an animation as an image map
Date: 14 Aug 1998 02:04:39
Message: <35d3c567.0@news.povray.org>
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?

Thank you for any help you can give me!!


Post a reply to this message

From: Johannes Hubert
Subject: Re: using an animation as an image map
Date: 14 Aug 1998 03:18:13
Message: <35d3d6a5.0@news.povray.org>
me wrote in message <35d3c567.0@news.povray.org>...
>The question is.....  (drum roll please)   how do I convert the integer
>current_frame to a string so that I can concatenate it?
[snip]
>Is this stated explicitly in the manual?

Yes it is :-)
See chapter: 7.1.8.3 String Functions and the "str" function.

Be warned though, that I have read several posts in the past, that there is
a bug in this function, in connection with the functions ability to prefix
the resulting string with zeros (do some tests of your own to see what
happens if you use the "Prefix Zeros" option).

Johannes.


Post a reply to this message

From: Vahur Krouverk
Subject: Re: using an animation as an image map
Date: 14 Aug 1998 11:04:55
Message: <35D44432.D7DACEA0@fv.aetec.ee>
Johannes Hubert wrote:

> Be warned though, that I have read several posts in the past, that there is
> a bug in this function, in connection with the functions ability to prefix
> the resulting string with zeros (do some tests of your own to see what
> happens if you use the "Prefix Zeros" option).
>
> Johannes.

Unofficial 3.0x compiles (e.g. isosurf patch) don't have this problem.
In 3.1 beta (5) it seems to work, thought I don't know, what happens, when
official (fully optimized) release gets out, for it seemed to be compiler's
(optimizer) bug, not coding one.


Post a reply to this message

From: Chris Colefax
Subject: Re: using an animation as an image map
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

From: Steven Jones
Subject: Re: using an animation as an image map
Date: 10 Jun 1999 03:55:52
Message: <375F6F86.3A636DC5@tsn.cc>
To get a string containing the current frame use
str(clock/clock_delta+1,-4,0).


Post a reply to this message

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