# live coding demo # this file is read by livecode.pf in the drawing loop 1 blend # enable blending 0 depth # diable depth test ((.1 .13 .16 1.0)) >matrix color # set drawing color # define some shape matrix containing triangle vertices ((1 0 0) (1 0 4) (1 1 0) (0 3 0) (4 1 0) (0 0 1)) >matrix variable! shape # draw shape above, randomly scaled : drawshape m-push rand scale shape @ triangles m-pop ; # recursive shape drawer : rshape # ( n -- ) 1 - dup 0 > if # node 1.23 scale 43. rotz dup m-push .5 transx rshape m-pop dup m-push -.5 transx rshape m-pop else # leaf 1. drawshape then drop ; # call the function above .7 scale 5 rshape