aUCBLogo Demos and Tests / 3dtreesh
to 3dtreesh
singleshot=Name? "framenr
if (not singleshot)
or2 [framenr==0]
[ clearScreen
clearShadows
hideTurtle
; disableRoundLineEnds ;uncomment for more speed
enableCylinderLines
enableShadows
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
back 350
; plane
pd
setPC white
; setpc brown
tree 6 150
castShadows
]
(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