POV-Ray : Newsgroups : povray.animations : loading different pics during an animation : Re: loading different pics during an animation Server Time
6 Oct 2024 11:38:56 EDT (-0400)
  Re: loading different pics during an animation  
From: Chris Colefax
Date: 6 Jan 2002 19:10:20
Message: <3c38e76c@news.povray.org>

[snip]
>       I'm working with Megapov and I'm wondering about strings:
>
>       Why can't I write Name instead of "FR11.tga"  inside the image
> map.
>       I like to change the number of the picture (11 to 12 to 13 etc.)
>       for loading different pics during an animation !!
>       How can I do this ?
>       Can I do something similar ?

The quotes are required around the image filename to identify it as a
string.  When you use a string variable, though, the quotes are not
required.  If you remove them from your declaration, you should find that
things work as expected.  Also, if you want to change the file number
through the animation, you can use the clock variable:

   #declare Name = concat("FR", str(1 + clock*19, -2, 0));
   ... image_map {tga Name ....

This uses files from FR01.tga to FR20.tga through the course of the
animation (from clock = 0 to 1).  Note the use of the -2 in the str()
function, to pad out the file numbers.  Also, it is not necessary to specify
the file extension if it matches the type of file (tga, in this case).


Post a reply to this message

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