Add transform, transform example.

This commit is contained in:
Aaron Morris
2019-07-21 20:15:56 -07:00
parent 605dd1fb9e
commit 1ca2f9776c
2 changed files with 64 additions and 1 deletions

25
examples/transform.lisp Normal file
View File

@@ -0,0 +1,25 @@
(resetTransform)
(clear)
(defn branch
(v)
(if
(gt v 0)
(
(scale 0.95)
(stroke
(line (pos 0 0) (pos 100 100))
10 "white")
(move 100 100)
(pushTransform)
(rotate (div v 50))
(branch (sub v 1))
(popTransform)
(pushTransform)
(rotate (div v -50))
(branch (sub v 1))
(popTransform)
)
)
)
(branch 10)