POV-Ray : Newsgroups : povray.animations : loading different pics during an animation Server Time
8 Jul 2024 16:06:44 EDT (-0400)
  loading different pics during an animation (Message 1 to 3 of 3)  
From: Rüdiger Geisler
Subject: loading different pics during an animation
Date: 5 Jan 2002 09:05:17
Message: <3C370800.4D6DCBC6@rz.uni-hildesheim.de>
Hello, here is a short example file :


camera{   location z*50    look_at  <0,0,0>  }

light_source{ <20,20,50> rgb <1,1,1> }

  #declare Name = concat("\"FR",str(11,0,0),".tga\"")   // this should
be  "FR11.tga"

   sphere {0, 10
    pigment {image_map {tga "FR11.tga" map_type 1 interpolate 2 transmit
255, 1.0}}
 // pigment {image_map {tga Name map_type 1 interpolate 2 transmit 255,
1.0}}       //That's what I wanna write!

      finish {ambient 0.3 diffuse .8}    }

   /*   Hello,
      please have a look at this very short pov.file

      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 ?
      Thank You for thinking it over.

      Best wishes
      Luck and Blessing
      Ruediger Geisler

    */


Post a reply to this message

From: bob h
Subject: Re: loading different pics during an animation
Date: 5 Jan 2002 11:20:41
Message: <3c3727d9@news.povray.org>
You could have a look at what I tried putting together a few years ago when
I was doing the same thing and it also confounded me as I tried to get the
numbers added in.  It could use improvement (esp. making into macro) but it
should do what you're wanting.

http://hometown.aol.com/xyzunknown/private/inxframe.zip

When you animate it and want the frame number you'll need to change the INI
file being used to make clock go from 1 (or zero) to the final frame number.
I put a description in there.

Other people have done this before and you might find a better way via macro
if you search the files newsgroups, or maybe someone will let you know if
they have such a thing.


Post a reply to this message

From: Chris Colefax
Subject: Re: loading different pics during an animation
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.