Mick Hazelgrove wrote:
>
> I want to translate an object. I often come across the situation where I
> want to randomly add a increment to a translation either side of zero. ie
> translate x* (+or - increment) usually in a loop.
>
I'm still a bit unclear, but perhaps this macro will do the job:
//Seed - declared random number seed
#macro PlusMinus(Seed)
#local U=rand(Seed);
#if(U<.5) (-1) #else 1 #end
#end
This returns -1 or 1 at random, so basically: x*PlusMinus(Seed)*y shall
alternate between incrementing and decrementing.
--
Margus Ramst
Personal e-mail: mar### [at] peakeduee
TAG (Team Assistance Group) e-mail: mar### [at] tagpovrayorg
Post a reply to this message
|