|
![](/i/fill.gif) |
Paul Bourke wrote:
>
> My question now is how can I automate this texture handling without the
> tedious in the way I'm doing it now, just repeating each declaration.
> In the end I hope to have "hundreds" of textures.
>
> So I will have one of these for each texture
>
> #declare texture01 = texture { pigment { image_map { tga "textures/tex01.tga" once }
} finish { texfinish } }
> #declare texture02 = texture { pigment { image_map { tga "textures/tex02.tga" once }
} finish { texfinish } }
> :
> :
> etc, 35 times
Use arrays:
#declare Textures=array[35]
#local Cnt=0;
#while (Cnt<35)
#declare Textures[Cnt] =
texture {
pigment {
image_map {
tga concat("textures/tex",str(-2, 0, Cnt),".tga")
once
}
}
finish { texfinish }
}
#local Cnt=Cnt+1;
#end
(Untested - could contain errors)
Note you should be careful with using all lower case custom identifiers
- if future versions of POV-Ray introduce keywords with the same name
your scene will get incompatible.
Christoph
--
POV-Ray tutorials, include files, Landscape of the week:
http://www.imagico.de/ (Last updated 31 Oct. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/
Post a reply to this message
|
![](/i/fill.gif) |