POV-Ray : Newsgroups : povray.animations : concat problem Server Time
8 Jul 2024 16:44:02 EDT (-0400)
  concat problem (Message 1 to 10 of 10)  
From: Dennis Milller
Subject: concat problem
Date: 7 Feb 2002 16:24:41
Message: <3c62f099$1@news.povray.org>
I'm trying to use a Targa file in a height field. I'm calling the file via
the following string:
height_field {
tga concat("d:\\povray\\penfilter\\fig", str(1,-2,0), ".tga")


which I would expect to return
height_field {tga "d:\povray\penfilter\fig001.tga"


But I continue to get the message: Error opening TGA image. There are a
series of files in that directory called fig001.tga through fig100.tga, and
when I use the code:

tga "d:\povray\penfilter\fig001.tga"

by itself, the file renders.

I assume there is something wrong with the concat parameters (sorry, I don't
know how to use #debug), but the "-2" above should pad "fig1" with two
zeroes, as in:  "fig001"  correct?
Anyway, maybe it is something with the double quotes? Ultimately, I plan to
use a sequence of Targa files (all 100 of them) and wonder if I can use
str(clock*100,-2,0)
but would POV see "clock" as a text string, or is that a reserved string
that it will correctly see as the clock?

Please let me know if anyone has any specific suggestions.
Thanks very much,
Dennis

--
dhm### [at] mediaonenet
www.casdn.neu.edu/~dmiller


Post a reply to this message

From: Warp
Subject: Re: concat problem
Date: 7 Feb 2002 16:43:28
Message: <3c62f500@news.povray.org>
Dennis Milller <dhm### [at] mediaonenet> wrote:
: I assume there is something wrong with the concat parameters (sorry, I don't
: know how to use #debug), but the "-2" above should pad "fig1" with two
: zeroes, as in:  "fig001"  correct?

  Nope. It makes the integer part 2 digits long with padded zeros if the
number is not big enough. That is, you get "fig01".
  Try with -3.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Dennis Milller
Subject: Re: concat problem
Date: 7 Feb 2002 17:05:55
Message: <3c62fa43$1@news.povray.org>
Yes! You are correct, and -3 works.

Next challenge:
I would like to read in a series of files starting with fig001.tga and
ending with fig100.tga

But whereas I would use "clock*100" in most cases, that does not work in the
string:

concat("d:\\povray\\penfilter\\fig", str(clock*100,-3,0), ".tga")

I assume the multiplier (*) is read as text? or maybe clock? (That may not
be true...) But could you suggest a way to read in the sequence of images
from 001 to 100?
Thanks again very much,
Dennis

"Warp" <war### [at] tagpovrayorg> wrote in message
news:3c62f500@news.povray.org...
> Dennis Milller <dhm### [at] mediaonenet> wrote:
> : I assume there is something wrong with the concat parameters (sorry, I
don't
> : know how to use #debug), but the "-2" above should pad "fig1" with two
> : zeroes, as in:  "fig001"  correct?
>
>   Nope. It makes the integer part 2 digits long with padded zeros if the
> number is not big enough. That is, you get "fig01".
>   Try with -3.
>
> --
> #macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb
x]
> [1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
> -1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// -
Warp -


Post a reply to this message

From: Warp
Subject: Re: concat problem
Date: 7 Feb 2002 18:20:54
Message: <3c630bd5@news.povray.org>
You should learn to use the #debug stream to print what you are creating
to the console. That is, create the file name you want to open and print
this file name with #debug to see that it's correct. For example:

#declare Filename = concat(whatever);
#debug concat("Filename to read: ", Filename, "\n")

  This way you can check that what you are creating is correct.

  Anyways, your problem is that you are using clock*100. The first calue
clock gets is 0, and 0*100 = 0. That is, you are getting the number "000",
not "001".

  The easiest way of fixing this is to use frame_number instead of clock*100.
frame_number gets consecutive integer numbers starting from 1, and that's
exactly what you want.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Dennis Milller
Subject: Re: concat problem
Date: 7 Feb 2002 20:30:09
Message: <3c632a21@news.povray.org>
Okay. That's it.
Thanks again for your help.
I'll look into debug.
Best,
D.

"Warp" <war### [at] tagpovrayorg> wrote in message
news:3c630bd5@news.povray.org...
>   You should learn to use the #debug stream to print what you are creating
> to the console. That is, create the file name you want to open and print
> this file name with #debug to see that it's correct. For example:
>
> #declare Filename = concat(whatever);
> #debug concat("Filename to read: ", Filename, "\n")
>
>   This way you can check that what you are creating is correct.
>
>   Anyways, your problem is that you are using clock*100. The first calue
> clock gets is 0, and 0*100 = 0. That is, you are getting the number "000",
> not "001".
>
>   The easiest way of fixing this is to use frame_number instead of
clock*100.
> frame_number gets consecutive integer numbers starting from 1, and that's
> exactly what you want.
>
> --
> #macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb
M()}}
> N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
> N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  -
Warp -


Post a reply to this message

From: Fidel viegas
Subject: Re: concat problem
Date: 5 Sep 2002 12:19:54
Message: <B99D41EB.413B%fidel.viegas@artrecognition.co.uk>
in article 3c62fa43$1@news.povray.org, Dennis Milller at
dhm### [at] mediaonenet wrote on 7/2/02 11:02 pm:

> Yes! You are correct, and -3 works.
> 
> Next challenge:
> I would like to read in a series of files starting with fig001.tga and
> ending with fig100.tga
> 
> But whereas I would use "clock*100" in most cases, that does not work in the
> string:
> 
> concat("d:\\povray\\penfilter\\fig", str(clock*100,-3,0), ".tga")

why not use the frame_number?
that is:

concat("d:\\povray\\penfilter\\fig", str(frame_number, -3, 0), ".tga")

if you set your initial frame to 1 and your final frame to 100, you will get
fig001.tga to fig100.tga.

All the best

Fidel.


Post a reply to this message

From: Fidel viegas
Subject: Re: concat problem
Date: 5 Sep 2002 12:20:37
Message: <B99D4218.413C%fidel.viegas@artrecognition.co.uk>
Sorry, I didn't notice it was an old message.
But, anyway it should help others.

All the best

Fidel.

in article 3c62fa43$1@news.povray.org, Dennis Milller at
dhm### [at] mediaonenet wrote on 7/2/02 11:02 pm:

> Yes! You are correct, and -3 works.
> 
> Next challenge:
> I would like to read in a series of files starting with fig001.tga and
> ending with fig100.tga
> 
> But whereas I would use "clock*100" in most cases, that does not work in the
> string:
> 
> concat("d:\\povray\\penfilter\\fig", str(clock*100,-3,0), ".tga")
> 
> I assume the multiplier (*) is read as text? or maybe clock? (That may not
> be true...) But could you suggest a way to read in the sequence of images
> from 001 to 100?
> Thanks again very much,
> Dennis
> 
> "Warp" <war### [at] tagpovrayorg> wrote in message
> news:3c62f500@news.povray.org...
>> Dennis Milller <dhm### [at] mediaonenet> wrote:
>> : I assume there is something wrong with the concat parameters (sorry, I
> don't
>> : know how to use #debug), but the "-2" above should pad "fig1" with two
>> : zeroes, as in:  "fig001"  correct?
>> 
>> Nope. It makes the integer part 2 digits long with padded zeros if the
>> number is not big enough. That is, you get "fig01".
>> Try with -3.
>> 
>> --
>> #macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb
> x]
>> [1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
>> -1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// -
> Warp -
> 
>


Post a reply to this message

From: Fidel viegas
Subject: Re: concat problem
Date: 9 Sep 2002 06:53:13
Message: <B9A23B43.47D2%fidel.viegas@artrecognition.co.uk>
in article B99D41EB.413B%fid### [at] artrecognitioncouk, Fidel viegas at
fid### [at] artrecognitioncouk wrote on 5/9/02 5:16 pm:

> in article 3c62fa43$1@news.povray.org, Dennis Milller at
> dhm### [at] mediaonenet wrote on 7/2/02 11:02 pm:
> 
>> Yes! You are correct, and -3 works.
>> 
>> Next challenge:
>> I would like to read in a series of files starting with fig001.tga and
>> ending with fig100.tga
>> 
>> But whereas I would use "clock*100" in most cases, that does not work in the
>> string:
>> 
>> concat("d:\\povray\\penfilter\\fig", str(clock*100,-3,0), ".tga")
> 
> why not use the frame_number?
> that is:
> 
> concat("d:\\povray\\penfilter\\fig", str(frame_number, -3, 0), ".tga")
> 
> if you set your initial frame to 1 and your final frame to 100, you will get
> fig001.tga to fig100.tga.

correction, it will generate fig1.tga to fig100.tga.

Fidel.


Post a reply to this message

From: Warp
Subject: Re: concat problem
Date: 9 Sep 2002 07:26:51
Message: <3d7c857a@news.povray.org>
Fidel viegas <fid### [at] artrecognitioncouk> wrote:
>> concat("d:\\povray\\penfilter\\fig", str(frame_number, -3, 0), ".tga")
>> 
>> if you set your initial frame to 1 and your final frame to 100, you will get
>> fig001.tga to fig100.tga.

> correction, it will generate fig1.tga to fig100.tga.

  Are you sure? A small test:

#declare Ind = 1;
#while(Ind <= 20)
  #debug concat("fig", str(Ind, -3, 0), ".tga\n")
  #declare Ind = Ind+1;
#end

  This prints "fig001.tga" to "fig020.tga".

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Fidel viegas
Subject: Re: concat problem
Date: 10 Sep 2002 19:58:33
Message: <B9A444E4.4845%fidel.viegas@artrecognition.co.uk>
in article 3d7c857a@news.povray.org, Warp at war### [at] tagpovrayorg wrote on
9/9/02 12:26 pm:

> Fidel viegas <fid### [at] artrecognitioncouk> wrote:
>>> concat("d:\\povray\\penfilter\\fig", str(frame_number, -3, 0), ".tga")
>>> 
>>> if you set your initial frame to 1 and your final frame to 100, you will get
>>> fig001.tga to fig100.tga.
> 
>> correction, it will generate fig1.tga to fig100.tga.
> 
> Are you sure? A small test:
> 
> #declare Ind = 1;
> #while(Ind <= 20)
> #debug concat("fig", str(Ind, -3, 0), ".tga\n")
> #declare Ind = Ind+1;
> #end
> 
> This prints "fig001.tga" to "fig020.tga".

You are correct, I used a 0 instead of -3 in str.

Apologies

Fidel.


Post a reply to this message

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