|
 |
The Cegorach wrote:
>
> When you speak of random transformations, is this achieved by a
> function with POV-Ray, such as a Do/While loop, or do you do it by
> hand?
>
Certainly not by hand, I hate manual labour :P
POV has a rand() function, you can use this to create random transformation
vectors (as in Gail's example).
If the pillars are placed regularly, you can create them with a while loop; each
time the parser goes through the loop and encounters the rand() function, a
different random number is created (ranging from 0 to 1).
Of course you can also position the pillars by hand and give a random texture
transformation to each copy separately.
Here are two macros you might find useful (the second needs access to the first
one to run):
//Give a random number of given mean and maximum deviation
//M - mean value
//D - maximum deviation
//Seed - (declared) random number seed identifier
#macro rand_ext(M,D,Seed)
(M+(rand(Seed)-.5)*2*D)
#end
//Give a random vector of given mean and max deviation
//M - mean (vector/float)
//D - max deviation (vector/float)
//Seed - (declared) random number seed identifier
#macro v_rand_ext(M,D,Seed)
#local MV=M+<0,0,0>;
#local DV=D+<0,0,0>;
(<rand_ext(MV.x,DV.x,Seed),rand_ext(MV.y,DV.y,Seed),rand_ext(MV.z,DV.z,Seed)>)
#end
--
Margus Ramst
Personal e-mail: mar### [at] peak edu ee
TAG (Team Assistance Group) e-mail: mar### [at] tag povray org
Home page http://www.hot.ee/margusrt
Post a reply to this message
|
 |