POV-Ray : Newsgroups : povray.animations : JPEGs and Movies Server Time
19 May 2024 02:20:42 EDT (-0400)
  JPEGs and Movies (Message 1 to 9 of 9)  
From: James
Subject: JPEGs and Movies
Date: 7 Jan 2006 15:40:00
Message: <web.43c025da29abda0df5c315de0@news.povray.org>
I have a series of JPEG files I exported from Adobe Premiere and I want to
use these in an animation as images on a screen within the animation. The
line I use to successfully put one image up is

#box { <0.0, 0.0, -screenthi> <screenwid, screenhei, screenthi> finish {
ambient 1 diffuse 0.9 } pigment { image_map { jpeg "filename.jpg" once
interpolate 2.0 } scale <screenwid, screenhei, screenthi> } translate
<-screenwid/2, 0, 0>}

the filenames are from train0001.jpg to train7046.jpg so I want to use the
clock to change the input file so that the code will look at the right
frame. I tried using a concatenation script however parenthesis around the
filename didn't allow that. How do I achieve this result?


Post a reply to this message

From: Trevor G Quayle
Subject: Re: JPEGs and Movies
Date: 7 Jan 2006 16:30:00
Message: <web.43c03256cff073b1c8947640@news.povray.org>
"James" <bat### [at] hotmailcom> wrote:
> I have a series of JPEG files I exported from Adobe Premiere and I want to
> use these in an animation as images on a screen within the animation. The
> line I use to successfully put one image up is
>
> #box { <0.0, 0.0, -screenthi> <screenwid, screenhei, screenthi> finish {
> ambient 1 diffuse 0.9 } pigment { image_map { jpeg "filename.jpg" once
> interpolate 2.0 } scale <screenwid, screenhei, screenthi> } translate
> <-screenwid/2, 0, 0>}
>
> the filenames are from train0001.jpg to train7046.jpg so I want to use the
> clock to change the input file so that the code will look at the right
> frame. I tried using a concatenation script however parenthesis around the
> filename didn't allow that. How do I achieve this result?


instead of using concat within the filename:
image_map { jpeg concat("filename", str(filenum,0,0),".jpg")}

try predeclaring it:

#declare filnam = concat("filename", str(filenum,0,0),".jpg");
image_map {jpeg filam}

-tgq


Post a reply to this message

From: Mike Williams
Subject: Re: JPEGs and Movies
Date: 8 Jan 2006 01:46:27
Message: <Qc3noIAhTLwDFwkc@econym.demon.co.uk>
Wasn't it Trevor G Quayle who wrote:
>"James" <bat### [at] hotmailcom> wrote:
>> I have a series of JPEG files I exported from Adobe Premiere and I want to
>> use these in an animation as images on a screen within the animation. The
>> line I use to successfully put one image up is
>>
>> #box { <0.0, 0.0, -screenthi> <screenwid, screenhei, screenthi> finish {
>> ambient 1 diffuse 0.9 } pigment { image_map { jpeg "filename.jpg" once
>> interpolate 2.0 } scale <screenwid, screenhei, screenthi> } translate
>> <-screenwid/2, 0, 0>}
>>
>> the filenames are from train0001.jpg to train7046.jpg so I want to use the
>> clock to change the input file so that the code will look at the right
>> frame. I tried using a concatenation script however parenthesis around the
>> filename didn't allow that. How do I achieve this result?
>
>
>instead of using concat within the filename:
>image_map { jpeg concat("filename", str(filenum,0,0),".jpg")}
>
>try predeclaring it:
>
>#declare filnam = concat("filename", str(filenum,0,0),".jpg");
>image_map {jpeg filam}

You may need to use str(filenum,-4,0) to get the leading zeroes in
"train0001.jpg".

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: James
Subject: Re: JPEGs and Movies
Date: 8 Jan 2006 02:15:00
Message: <web.43c0bbcfcff073b1f5c315de0@news.povray.org>
> >instead of using concat within the filename:
> >image_map { jpeg concat("filename", str(filenum,0,0),".jpg")}
> >
> >try predeclaring it:
> >
> >#declare filnam = concat("filename", str(filenum,0,0),".jpg");
> >image_map {jpeg filam}
>
> You may need to use str(filenum,-4,0) to get the leading zeroes in
> "train0001.jpg".

Appreciate the help lads, but neither of those methods worked, I put
together 1000 lines in excel the easy way and imported it into a
switch/case routine and got the desired result, but its still tedious.


Post a reply to this message

From: Warp
Subject: Re: JPEGs and Movies
Date: 8 Jan 2006 02:37:50
Message: <43c0c14e@news.povray.org>
James <bat### [at] hotmailcom> wrote:
> Appreciate the help lads, but neither of those methods worked

  So you just dismissed them without giving them a second thought?

  Please read the help files about str() and concat() and try to
solve *why* it didn't work for you. The principle was correct, so
if it didn't work it's because you did something wrong (a typo
perhaps?), not because it's not possible.

-- 
                                                          - Warp


Post a reply to this message

From: Ger
Subject: Re: JPEGs and Movies
Date: 8 Jan 2006 05:14:10
Message: <43c0e5f1@news.povray.org>
James wrote:

>> >instead of using concat within the filename:
>> >image_map { jpeg concat("filename", str(filenum,0,0),".jpg")}
>> >
>> >try predeclaring it:
>> >
>> >#declare filnam = concat("filename", str(filenum,0,0),".jpg");
>> >image_map {jpeg filam}
>>
>> You may need to use str(filenum,-4,0) to get the leading zeroes in
>> "train0001.jpg".
> 
> Appreciate the help lads, but neither of those methods worked, I put
> together 1000 lines in excel the easy way and imported it into a
> switch/case routine and got the desired result, but its still tedious.

This works most definitely (because I use it in an animation)

#declare PaintingName =
concat("art/MBclear/DK44",str(frame_number-4300,-5,0),".png");
// art/MBclear being the folder where the images are
// DK44 is the base name with the str() bit giving DK4400001.png through
// DK4410000.png

#declare ClearPainting1 =
union {
        object {PngPainting (PaintingName, 400, 225, 1 , 0, 12.5, no, < 0,0,0>)}
        object { ScrewSet }
        }

// PngPainting is a macro that scales, rotates and frames the image

// And here I place it in the scene
object { ClearPainting1 translate <  1000, 412.5, 20> }


See, no need for 1000's of lines bundled in Excel. Since I have a total of
18 of these moving paintings over a total animation of 10.000 frames that
would give me 180.000 lines of case statements. No, thank you. I like the
above a lot more

Hope this helps
-- 
Ger


Post a reply to this message

From: Charles C
Subject: Re: JPEGs and Movies
Date: 8 Jan 2006 16:05:01
Message: <web.43c17d50cff073b158035aeb0@news.povray.org>
It's like when the string connected to the trigger mechanism breaks at the
wrong time and you find yourself stuck in your own trap... try something
that involves a rocket instead!  It's what Wile E. Coyote would do! ;)

Actually I think sometimes if you're in a hurry there's not time to work out
the bugs even when you know the better way exists...

Charles


Post a reply to this message

From: Jaap
Subject: Re: JPEGs and Movies
Date: 8 Jan 2006 18:05:00
Message: <web.43c19a26cff073b1a8399d8d0@news.povray.org>
here is what i have used before:

texture {
  pigment {
    image_map {
      jpeg concat(str(frame_number,-8,0),".jpg")  // ("00000001.jpg", etc)
      map_type 0
      interpolate 2
      once
    }
    translate <-0.5,-0.5,0>   // center background
  }
}

Jaap.


Post a reply to this message

From: Jaap
Subject: Re: JPEGs and Movies
Date: 8 Jan 2006 18:20:01
Message: <web.43c19d46cff073b1a8399d8d0@news.povray.org>
Also, there is no need to use XL. pov-ray is very good at generating
textfiles!
have a look at my rename.pov, it generates a windows/linux rename
batchfile/script (and a black image as a bonus :-)

http://news.povray.org/povray.binaries.utilities/thread/%3Cweb.4240b2b0f6941213a8399d8d0%40news.povray.org%3E/

so you could use pov-ray to generate a pov-ray include file with the big
switch statement...


Post a reply to this message

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