summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Cichon <ebrasca.ebrasca@openmailbox.org>2017-06-25 12:48:15 +0200
committerBruno Cichon <ebrasca.ebrasca@openmailbox.org>2017-06-25 12:48:15 +0200
commiteccad305a24dd1365adeb9f49986f7ca898c0f5a (patch)
treefc04ae8b9844f833ebda369cf9c0512d299efd24
parentbc12fdabb402a5573f156134e51548a20855ed79 (diff)
Optimize extrusion.HEADmaster
-rw-r--r--turtle.lisp16
1 files changed, 7 insertions, 9 deletions
diff --git a/turtle.lisp b/turtle.lisp
index 9aa9fbc..3d59787 100644
--- a/turtle.lisp
+++ b/turtle.lisp
@@ -31,15 +31,13 @@
(defun extrusion (turtle n)
(mapcar #'(lambda (vertex)
(add-point
- (m4:get-column
- (let* ((x (v4:- (aref *vertices* vertex) (tra turtle)))
- (y (v4:*S x (* (r turtle)
- (sqrt (v:dot x x))))))
- (m4:* (m4:translation (v4:+ (tra turtle)
- (v4:*S (m4:get-column (rot turtle) 1) n)))
- (rot turtle)
- (m4:translation (v4:- x y))))
- 3)))
+ (let* ((x (v4:- (aref *vertices* vertex) (tra turtle))))
+ (v4:+ (tra turtle)
+ (v4:*S (m4:get-column (rot turtle) 1) n)
+ (m4:*v (rot turtle)
+ (v4:- x
+ (v4:*S x (* (r turtle)
+ (sqrt (v:dot x x))))))))))
(points turtle)))
(defun forward (turtle n)