SharkD <mik### [at] gmailcom> wrote:
> On 6/4/2010 5:31 PM, Edouard wrote:
> > "Edouard"<pov### [at] edouardinfo> wrote:
> > Opps - I mean:
> > #macro halton2D( n )
> > #local baseX = 2;
> > #local baseY = 3;
> > < halton( n, baseX ), halton( n, baseY ), 0>
> > #end
> Could you provide an example of how to use it? Thanks.
The halton macro returns a number from 0..1, and halton2D() returns a vector
where the X is 0..1, Y is 0..1 and the Z = 0.
You call halton2D() with an incrementing integer, so it works best in a loop.
If you had a macro called PlaceTree(), you could loop through values from
halton2D calling the tree macro like this:
#declare n = 1;
#while( n < number_of_trees_wanted )
#declare position = halton2D( n );
// position is <0..1, 0..1, 0> - scale the vector here
// to the size you need for PlaceTree
PlaceTree( position )
#declare n = n + 1;
Does my explanation make sense?
Post a reply to this message