|
|
news:412bf930$1@news.povray.org...
>
> #macro buildtree(aty,rotz, scl, depth)
> union {
> tree(0,0,1)
> #if (depth = 15)
> leave(8,atan2d(4,3),.75)
> leave(7,-atan2d(3,4),.75)
> #else
> buildtree(8,atan2d(4,3),.75, depth+1) // depth increases with each call
> buildtree(7,-atan2d(3,4),.75, depth+1)
> #end
> scale <scl,scl,scl>
> rotate <0,72,rotz>
> translate <0,aty,0>
> }
>
> buildtree(0,0,1, 0 /* initial depth of zero */)
>
There is a better way to do it:
#macro buildtree(aty,rotz, scl, depth)
union {
tree(0,0,1)
#if (depth = 16)
cylinder { <0, 0, 0>, <0, 10, 0>, 1
pigment{ rgb <0,1,0>}
scale <scl*4,scl*2,scl/3>
rotate <0,0,rotz>
translate <0,aty,0>
}
#else
buildtree(8,atan2d(4,3),.75, depth+1) // depth increases with each call
buildtree(7,-atan2d(3,4),.75, depth+1)
#end
scale <scl,scl,scl>
rotate <0,72,rotz>
translate <0,aty,0>
}
--
- Nicolas Alvarez
nicoalvar0 [at] hotmail [dot] com
Post a reply to this message
|
|