POV-Ray : Newsgroups : povray.general : string interpretation : Re: string interpretation Server Time
31 Jul 2024 06:15:06 EDT (-0400)
  Re: string interpretation  
From: Alain
Date: 18 Sep 2007 00:45:06
Message: <46ef57d2$1@news.povray.org>
Jim nous apporta ses lumieres en ce 2007/09/17 19:59:
> I'm trying to create a sort of "catalog" of textures in the various standard
> include files - for instance, "woods.inc" which defines T_Wood1 through
> T_Wood35.
> 
> After setting up a simple test scene, I convert it into an animation so that
> each texture is rendered in its own frame. I find myself wanting to define
> the texture that is used based on the frame number thusly:
> 
> #declare textString = concat ("T_Wood",str(frame_number,2,0));
> [...]
> texture { textString }
> 
> That doesn't work. :(
> 
> 
> So am I left with a hand-coded #switch statement with a series of #cases-
> #case(n)
> #declare MyTexture = texture{T_Wood<n>}
> #break
> 
> There's no "casting" of a string to any other type. Or is there perhaps some
> magic solution I'm not seeing?
> 
> The "woods" file is actually pretty easy to enumerate compared to some of
> the others - so I'm really after a more general solution. I know I could
> whip something up in Perl that would spit out scene files dynamically (and
> of course call up POV with input from stdin) but I would like to keep
> everything in the POV SDL if possible.
> 
> Thanks for any tips/hints anyone can offer.
> 
> 
Already done for you. Look at the portfolio folder and run the various *.ini 
files you find there. It will generate all the textures, pigments, materials, 
primitives and some more, and the html code to view them in any browser.

For example, you will get 7 wood pages showing 6 wooden textures each.

-- 
Alain
-------------------------------------------------
   It's tough to stay married. My wife kisses the dog on the lips, Yet she won't 
drink from my glass!
	Rodney Dangerfield


Post a reply to this message

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