diff 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
line wrap: on
line diff
     1.1 --- a/org/touch.org	Mon Feb 13 08:20:25 2012 -0700
     1.2 +++ b/org/touch.org	Mon Feb 13 20:19:34 2012 -0700
     1.3 @@ -615,6 +615,10 @@
     1.4        background main-view touch targets))))
     1.5  #+end_src
     1.6  
     1.7 +#+begin_src sh :results silent
     1.8 +cd /home/r/proj/cortex/render/touch-cube/
     1.9 +ffmpeg -r 60 -i out/%07d.png -b:v 9000k -c:v libtheora basic-touch.ogg
    1.10 +#+end_src
    1.11  
    1.12  * Adding Touch to the Worm
    1.13  
    1.14 @@ -626,7 +630,9 @@
    1.15  
    1.16  (cortex.import/mega-import-jme3)
    1.17  
    1.18 -(defn test-touch []
    1.19 +(defn test-touch 
    1.20 +  ([] (test-touch false))
    1.21 +([record?]
    1.22    (let [the-worm (doto (worm) (body!))
    1.23          touch (touch! the-worm)
    1.24          touch-display (view-touch)]
    1.25 @@ -634,14 +640,25 @@
    1.26             standard-debug-controls
    1.27             
    1.28             (fn [world]
    1.29 +             (if record? 
    1.30 +               (Capture/captureVideo 
    1.31 +                 world
    1.32 +                 (File. "/home/r/proj/cortex/render/worm-touch/main-view/")))
    1.33               (speed-up world)
    1.34               (light-up-everything world))
    1.35  
    1.36             (fn [world tpf]
    1.37               (touch-display 
    1.38 -              (map #(% (.getRootNode world)) touch))))))
    1.39 +              (map #(% (.getRootNode world)) touch)
    1.40 +(if record? 
    1.41 +(File. "/home/r/proj/cortex/render/worm-touch/touch/"))
    1.42 +
    1.43 +)))))
    1.44  #+end_src
    1.45  
    1.46 +
    1.47 +
    1.48 +
    1.49  * Headers 
    1.50  
    1.51  #+name: touch-header