made roate-* now can take a vector
This commit is contained in:
parent
fe2dcf99f4
commit
75e3aea0ea
|
@ -81,7 +81,7 @@
|
||||||
(make-thruster-vertices
|
(make-thruster-vertices
|
||||||
(transform-points (translate-points *3pyramid-points* (vector 0 0 0.5)) (vector 4 1 1.01))
|
(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))
|
;'( (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))
|
; '( (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))
|
2))
|
||||||
; '((0.0 0.5 0.0) (-2.0 -0.5 0.0) (2.0 -0.5 0.0)
|
; '((0.0 0.5 0.0) (-2.0 -0.5 0.0) (2.0 -0.5 0.0)
|
||||||
|
|
14
math.lisp
14
math.lisp
|
@ -53,15 +53,15 @@
|
||||||
(loop for v across tri collecting (translate-point position v))))
|
(loop for v across tri collecting (translate-point position v))))
|
||||||
|
|
||||||
(defun rotate-triangle (points m)
|
(defun rotate-triangle (points m)
|
||||||
; (if (not (vectorp (aref m 0)))
|
(if (not (eql (second (type-of m)) t))
|
||||||
; (rotate-triangle points (make-rotation-matrix m)))
|
(rotate-triangle points (make-rotation-matrix m))
|
||||||
(make-array (length points) :initial-contents
|
(make-array (length points) :initial-contents
|
||||||
(loop for v across points collecting (rotate* m v))))
|
(loop for v across points collecting (rotate* m v)))))
|
||||||
|
|
||||||
(defun rotate-points (points m)
|
(defun rotate-points (points m)
|
||||||
; (if (not (vectorp (aref m 0)))
|
(if (not (eql (second (type-of m)) t))
|
||||||
; (rotate-points points (make-rotation-matrix m)))
|
(rotate-points points (make-rotation-matrix m))
|
||||||
(make-array (length points) :initial-contents (loop for tri across points collecting (rotate* m tri))))
|
(make-array (length points) :initial-contents (loop for tri across points collecting (rotate* m tri)))))
|
||||||
|
|
||||||
|
|
||||||
(defun scale-vector (v a)
|
(defun scale-vector (v a)
|
||||||
|
|
|
@ -109,7 +109,8 @@
|
||||||
(defparameter *ship-model*
|
(defparameter *ship-model*
|
||||||
(make-model-3pyramid ;*3pyramid-flat-points*
|
(make-model-3pyramid ;*3pyramid-flat-points*
|
||||||
(transform-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))
|
(vector 4 1 3))
|
||||||
:face-colors '((196 196 196) (196 196 196) (196 196 196) (32 32 32))))
|
:face-colors '((196 196 196) (196 196 196) (196 196 196) (32 32 32))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue