(in-package :LED-cube) (defun rotate-outer-plane () ;; incomplete (dolist (cube *animation*) (dotimes (x 5) (let ((led (aref cube x 0 0))) (setf (aref cube x 1 0) led))))) (defun copy-lowest-plane-to-others () (dolist (cube *animation*) (dotimes (x 5) (dotimes (y 5) (let ((led (aref cube 0 y x))) (princ led) (dotimes (z 5) (setf (aref cube z y x) led) )))) (princ #\newline) ) ) ;; Print the content of the select-buffer array: ;; (format t "~d objects found~%" objects-found) ;; (dotimes (i (* 5 4)) ;; (format t "~d: ~d~%" ;; i ;; (sgum:deref-array select-buffer '(:array gl:uint) i))) ;; (force-output) ;; Print the content of the select-buffer array (new local functions-version): ;; (format t "~%~d objects found~%" number-of-selected-objects) ;; (dotimes (i (* number-of-objects-to-store 4)) ;; (when (= 0 (mod i 4)) ;; (princ #\newline)) ;; (format t "~d: ~d~%" i (access-element-of-the-select-buffer-array i))) ;; (force-output) ;; Print the content of the viewport-coords array: ;; (dotimes (i 4) ;; (format t "~d: ~d~%" ;; i ;; (sgum:deref-array viewport-coords '(:array gl:int) i))) ;; (force-output) (defun cube-rotate (&optional (cube-to-rotate (current-cube))) (let ((new-cube (make-array (list *cube-dimension* *cube-dimension* *cube-dimension*)))) ; (let ((new-cube (make-cube))) (do-cube-times (x y z new-cube) (setf (aref new-cube x y z) (aref cube-to-rotate y x z))))) (defun cube-rotate2 (&optional (cube-to-rotate (current-cube))) (let ((new-cube (make-array (list *cube-dimension* *cube-dimension* *cube-dimension*)))) ; (let ((new-cube (make-cube))) (do-cube-times (x y z new-cube) (setf (aref new-cube x y z) (aref cube-to-rotate z x y))))) (defun mirror-cube (&optional (cube-to-mirror (current-cube))) (let ((new-cube (make-array (list *cube-dimension* *cube-dimension* *cube-dimension*)))) ; (let ((new-cube (make-cube))) (do-cube-times (x y z new-cube) (setf (aref new-cube x (- 4 y) z) (aref cube-to-mirror x y z))))) (defun create-numbered-cube () (let ((new-cube (make-array (list *cube-dimension* *cube-dimension* *cube-dimension*)))) (dotimes (led-number 125 new-cube) (destructuring-bind (z y x) (led-number-to-coord led-number) (setf (aref new-cube x y z) led-number))))) ;; This hack generate permutation array for the LED-Cube Analyzer XMMS Visualization plug-in. ;; http://www.entropia.de/wiki/LED-Cube#LED-Cube-Analyzer (defun create-rotation-string (&optional (cube (cube-rotate2 (create-numbered-cube)))) (do-cube-times (x y z) (format t "~d, " (aref cube x y z))))