How to plant a serie of trees semi-irregularly with a nested while loop.
For details on how to make this tree we use here, please take a look in the according scene file.
|
If we are planting trees
with a nested while loop the result will be
unnaturally regular. May be this way is good for cutting down
these trees but not very nice to look at!
|
|
Randomized size,
randomized tilting and
randomized rotating:
//-----------------------------------
// tilting around z direction
rotate<10*2*(0.5-rand(Random_3)),0,0>
// turning around y axis
rotate<0,360*rand(Random_0),0>
// changing scale
scale 1+0.5*rand(Random_1)
///----------------------------------
|
|
|
Randomized moving:
//-----------------------------------
// shifting in x and z:
translate
< NrX*2.75+2*(-0.5+rand(Random_2)),
0,
NrZ*2.75+2*(-0.5+rand(Random_2))>}
///----------------------------------
|
|
|
Another view of this little wood:
|
|