POV-Ray : Newsgroups : povray.newusers : Random texture? : Re: Random texture? Server Time
28 Sep 2024 18:17:28 EDT (-0400)
  Re: Random texture?  
From: Micke
Date: 6 Jan 2012 21:40:01
Message: <web.4f07b056dda100949c6257010@news.povray.org>
Alain <aze### [at] qwertyorg> wrote:

> >
> > 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

Thankyou for your reply, but still no success. Here is my code.
 #declare Rand = seed(1);
 #declare Count = 0;
 #while (Count <10)
 object{My_Column translate-x*12
//   texture {My_Marble rotate <rand(Rand),rand(Rand),rand(Rand)>}
  *Count  rotate - 100*y
     }
  #declare Count=Count+1;

 #end
All works untill I add the texture line, then this error:No matching } in
object',: found instead. What am I doing wrong,please.


Post a reply to this message

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