POV-Ray : Newsgroups : povray.programming : Replacing texture identifier by a concatenated string literal? Server Time
8 Jul 2024 19:00:38 EDT (-0400)
  Replacing texture identifier by a concatenated string literal? (Message 1 to 5 of 5)  
From: Jörg 'Yadgar' Bleimann
Subject: Replacing texture identifier by a concatenated string literal?
Date: 12 Nov 2002 16:55:42
Message: <3DD18746.F8A53CE3@tiscalinet.de>
Hi Tracers!

I want to program a simple scene with displays the various metal
textures of metals.inc
in square arrays of 5 x 5 spheres for each metal type.

To do this easily from a nested loop, I tried something like
texture { "concat("T_Brass_", str(a+1), chr(65+b))"},
but got an error message, whether I put the whole thing in
double quote marks or not. Is there any way at all to convert
a string literal into a texture (or object) identifier?

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Johannes Dahlstrom
Subject: Re: Replacing texture identifier by a concatenated string literal?
Date: 12 Nov 2002 17:12:38
Message: <3dd17cd5@news.povray.org>


> Is there any way at all to convert a string literal into a texture 
> (or object) identifier?

Check the Parse_String macro in strings.inc.


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: Replacing texture identifier by a concatenated string literal?
Date: 13 Nov 2002 01:38:11
Message: <3DD201B8.50E904CF@tiscalinet.de>
High!

Johannes Dahlstrom schrieb:

> Check the Parse_String macro in strings.inc.

Yes, I looked it up, but it seems quite cryptic to me, I just don't get
how it works and how it's used...
...and when I then tried
texture { Parse_String (concat("T_Bronze_", str(b+1), chr(65+a))) }
I got the error message
"Numeric expression expected but } found instead"...

See you in Khyberspace!

Yadgar

Now playing: The Gates of Delirium (Yes)


Post a reply to this message

From: hughes, b 
Subject: Re: Replacing texture identifier by a concatenated string literal?
Date: 13 Nov 2002 05:59:20
Message: <3dd23088@news.povray.org>

news:3DD201B8.50E904CF@tiscalinet.de...
> ...and when I then tried
> texture { Parse_String (concat("T_Bronze_", str(b+1), chr(65+a))) }
> I got the error message
> "Numeric expression expected but } found instead"...

str() needs a couple more parameters is all. Use str(b+1,0,0). Those are the
string length (plus padding)and decimal places. This way you get just the
float value as a integer. Otherwsie you've got it... except I don't know
where T_Bronze textures are, so guess you have them there someplace.
Metals.inc has Copper which is said to be bronze-like.
--
Farewell,
Bob


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Replacing texture identifier by a concatenated string literal?
Date: 13 Nov 2002 06:54:06
Message: <3dd23d5e$1@news.povray.org>

<yad### [at] tiscalinetde>  wrote:

> Hi Tracers!
>
> I want to program a simple scene with displays the various metal
> textures of metals.inc
> in square arrays of 5 x 5 spheres for each metal type.
>
> To do this easily from a nested loop, I tried something like
> texture { "concat("T_Brass_", str(a+1), chr(65+b))"},
> but got an error message, whether I put the whole thing in
> double quote marks or not. Is there any way at all to convert
> a string literal into a texture (or object) identifier?

Please note that this is the wrong group for your question.  this group is
about the POV-Ray source code, not about using POV-Ray.  Please read the
messages in the group  povray.announce.frequently-asked-question - they
explain which groups serve what purpose.

    Thorsten


Post a reply to this message

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