|
![](/i/fill.gif) |
>
> I am trying to randomise a texure in a while-loop.Is this possible,and how can I
> achive this please.
>
>
First, you initiate a random stream: #declare Rand = seed(0);
seed() takes any integer value as it's argument.
Then, in your loop, you use that stream to randomly create some pigment
or switch between patterns and create random colour_map, also using your
random stream.
You can create a stream to sellect your pattern and another for the colours.
You can create a random pigment like this:
pigment{rgb<rand(Rand),rand(Rand),rand(Rand)>}
pigment{rgbft<rand(Rand),rand(Rand),rand(Rand),rand(Rand)/2,rand(Rand)/2>}
will generate pigments that are transparent to various degrees.
You can use the #switch() #case()/#range() #break #end statement to
sellect between various patterns. Read the documentation about the
#switch() statement. The #break is mandatory.
Alain
Post a reply to this message
|
![](/i/fill.gif) |