|
![](/i/fill.gif) |
Chris Huff wrote:
> In article <3A9A89B3.F7059895@spiritone.com>, Josh English
> <eng### [at] spiritone com> wrote:
>
> > something and something else can be vectors, but they will distribute
> > within a straight line, so you will have to do this in triplicate for
> > three different vectors to fill space.
>
> Triplicate for three different vectors? Not quite, you just need three
> calls to rand()...try these macros:
>
> // "signed rand", ranges from -1 to 1
> #macro SRand(RS) (rand(RS)*2 - 1) #end
>
> // "ranged rand"
> #macro RRand(Mn, Mx, RS) (Mn + rand(RS)*(Mx-Mn)) #end
>
> // random point in cube from Mn to Mx
> #macro RandPt(Mn, Mx, RS)
> (Mn + < rand(RS), rand(RS), rand(RS)>*(Mx-Mn))
> #end
I feel so stupid for missing that. No wonder I gave up programming
--
Josh English -- Lexiphanic Lethomaniac
eng### [at] spiritone com
The POV-Ray Cyclopedia http://www.spiritone.com/~english/cyclopedia/
"He who hebetates is last."
Post a reply to this message
|
![](/i/fill.gif) |