Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

made roate-* now can take a vector

  • Loading branch information...
commit 75e3aea0eaf04a0d39252fef434c0d5efcd2c929 1 parent fe2dcf9
@dballard authored
Showing with 10 additions and 9 deletions.
  1. +1 −1  engine.lisp
  2. +7 −7 math.lisp
  3. +2 −1  model.lisp
View
2  engine.lisp
@@ -81,7 +81,7 @@
(make-thruster-vertices
(transform-points (translate-points *3pyramid-points* (vector 0 0 0.5)) (vector 4 1 1.01))
;'( (0.0 0.5 0.0) (-2.0 -0.5 0.0) (2.0 -0.5 0.0) (0.0 0.0 0.0))
- (transform-points (translate-points (rotate-points *3pyramid-points* (make-rotation-matrix (vector 0 0 0))) (vector 0 0 0.5)) (vector 4 1 1.5))
+ (transform-points (translate-points (rotate-points *3pyramid-points* (vector 0 0 0)) (vector 0 0 0.5)) (vector 4 1 1.5))
; '( (0.0 0.5 0.0) (-2.0 -0.5 0.0) (2.0 -0.5 0.0) (0.0 0.0 1.5))
2))
; '((0.0 0.5 0.0) (-2.0 -0.5 0.0) (2.0 -0.5 0.0)
View
14 math.lisp
@@ -53,15 +53,15 @@
(loop for v across tri collecting (translate-point position v))))
(defun rotate-triangle (points m)
-; (if (not (vectorp (aref m 0)))
-; (rotate-triangle points (make-rotation-matrix m)))
- (make-array (length points) :initial-contents
- (loop for v across points collecting (rotate* m v))))
+ (if (not (eql (second (type-of m)) t))
+ (rotate-triangle points (make-rotation-matrix m))
+ (make-array (length points) :initial-contents
+ (loop for v across points collecting (rotate* m v)))))
(defun rotate-points (points m)
-; (if (not (vectorp (aref m 0)))
-; (rotate-points points (make-rotation-matrix m)))
- (make-array (length points) :initial-contents (loop for tri across points collecting (rotate* m tri))))
+ (if (not (eql (second (type-of m)) t))
+ (rotate-points points (make-rotation-matrix m))
+ (make-array (length points) :initial-contents (loop for tri across points collecting (rotate* m tri)))))
(defun scale-vector (v a)
View
3  model.lisp
@@ -109,7 +109,8 @@
(defparameter *ship-model*
(make-model-3pyramid ;*3pyramid-flat-points*
(transform-points
- (rotate-points *3pyramid-flat-points* (make-rotation-matrix (vector 0 0 0)))
+ ;(rotate-points *3pyramid-flat-points* (make-rotation-matrix (vector 0 0 0)))
+ (rotate-points *3pyramid-flat-points* (vector 0 0 0))
(vector 4 1 3))
:face-colors '((196 196 196) (196 196 196) (196 196 196) (32 32 32))))
Please sign in to comment.
Something went wrong with that request. Please try again.