aUCBLogo Demos and Tests / 3dtree
to 3dtree
singleshot=Name? "framenr
if (not singleshot)
or2 [framenr==0]
[ cs ht
; disableRoundLineEnds ;uncomment for more speed
enableCylinderLines
WindowMode
white=RGB 1 1 1
setPC white
turtleskinbmp=LoadImage "turtleskin.png
turtleskintex=Texture turtleskinbmp
; ::brown=rgb .6 .3 0
; setScreenColor rgb .6 .6 1
perspective
setLightPos {100 100 100}
pu
bk 350
; plane
pd
setPC white
; setpc brown
ifelse singleshot
[ tree 5 150
][ tree 6 150
]
]
(rotatescene 3)
end
to tree level size
if level==0
[ disableTexture
(leaf 10)
enableTexture
setPC white
; setpc brown
stop
]
if keyp [stop] ;slow but good for makeDemoBMPs
setpensize list 4*level 4*level
make "p1 posxyz
fd :size
tree2 3/5 55 92
tree2 5/6 -10 80
tree2 3/5 -60 -72
pu
bk :size
pd
end
to tree2 :f :l :r
lt :l
rr :r
tree :level-1 :size*:f
; updateGraph
lr :r
rt :l
end