comparison org/touch.org @ 252:f1a74d23e7e4

added video generation code for touch
author Robert McIntyre <rlm@mit.edu>
date Mon, 13 Feb 2012 20:19:34 -0700
parents e9bce4f722b1
children e23717fefc7f
comparison
equal deleted inserted replaced
250:e9bce4f722b1 252:f1a74d23e7e4
613 target)) 613 target))
614 (fn [& args] (map #(.getCanonicalPath %) args))) 614 (fn [& args] (map #(.getCanonicalPath %) args)))
615 background main-view touch targets)))) 615 background main-view touch targets))))
616 #+end_src 616 #+end_src
617 617
618 #+begin_src sh :results silent
619 cd /home/r/proj/cortex/render/touch-cube/
620 ffmpeg -r 60 -i out/%07d.png -b:v 9000k -c:v libtheora basic-touch.ogg
621 #+end_src
618 622
619 * Adding Touch to the Worm 623 * Adding Touch to the Worm
620 624
621 #+name: test-touch 625 #+name: test-touch
622 #+begin_src clojure 626 #+begin_src clojure
624 (:use (cortex world util sense body touch)) 628 (:use (cortex world util sense body touch))
625 (:use cortex.test.body)) 629 (:use cortex.test.body))
626 630
627 (cortex.import/mega-import-jme3) 631 (cortex.import/mega-import-jme3)
628 632
629 (defn test-touch [] 633 (defn test-touch
634 ([] (test-touch false))
635 ([record?]
630 (let [the-worm (doto (worm) (body!)) 636 (let [the-worm (doto (worm) (body!))
631 touch (touch! the-worm) 637 touch (touch! the-worm)
632 touch-display (view-touch)] 638 touch-display (view-touch)]
633 (world (nodify [the-worm (floor)]) 639 (world (nodify [the-worm (floor)])
634 standard-debug-controls 640 standard-debug-controls
635 641
636 (fn [world] 642 (fn [world]
643 (if record?
644 (Capture/captureVideo
645 world
646 (File. "/home/r/proj/cortex/render/worm-touch/main-view/")))
637 (speed-up world) 647 (speed-up world)
638 (light-up-everything world)) 648 (light-up-everything world))
639 649
640 (fn [world tpf] 650 (fn [world tpf]
641 (touch-display 651 (touch-display
642 (map #(% (.getRootNode world)) touch)))))) 652 (map #(% (.getRootNode world)) touch)
643 #+end_src 653 (if record?
654 (File. "/home/r/proj/cortex/render/worm-touch/touch/"))
655
656 )))))
657 #+end_src
658
659
660
644 661
645 * Headers 662 * Headers
646 663
647 #+name: touch-header 664 #+name: touch-header
648 #+begin_src clojure 665 #+begin_src clojure