|
![](/i/fill.gif) |
The Cegorach <ceg### [at] yahoo com> wrote in message
news:a2e18tsfr93762o69mu3498gju9r2gicnj@4ax.com...
>
> 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?
I tend to use something like :
#declare rndTex=seed(4834);
texture {My_Marble_Texture translate
<100*rand(rnd),100*rand(rnd),100*rand(rnd)>}
Check the docs on seed and rand if not familiar with them
> I ask because I'm currently working on--you guessed--marble pillars.
> :-)
Granite pillars here, and just about finished.
Gail
********************************************************************
* gsh### [at] monotix co za * System.dat not found. *
* http://www.rucus.ru.ac.za/~gail/ * Reformat hard drive Y)es O)k *
********************************************************************
* If at first you don't succeed, call it version 1.0 *
********************************************************************
Post a reply to this message
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
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
|
![](/i/fill.gif) |