changeset 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
files org/hearing.org org/touch.org
diffstat 2 files changed, 19 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/org/hearing.org	Mon Feb 13 08:20:25 2012 -0700
     1.2 +++ b/org/hearing.org	Mon Feb 13 20:19:34 2012 -0700
     1.3 @@ -950,7 +950,6 @@
     1.4  #+end_src
     1.5  
     1.6  * Testing Hearing
     1.7 -
     1.8  ** Advanced Java Example
     1.9  
    1.10  I wrote a test case in Java that demonstrates the use of the Java
    1.11 @@ -1083,7 +1082,6 @@
    1.12    sound it hears beomes fainter. This shows the 3D localization of
    1.13    sound in this world.</p>
    1.14  </div>
    1.15 -
    1.16  #+end_html
    1.17  
    1.18  *** Creating the Ear Video
    1.19 @@ -1169,7 +1167,6 @@
    1.20  #+html: <ul> <li> <a href="../org/hearing.org">This org file</a> </li> </ul>
    1.21    - [[http://hg.bortreb.com ][source-repository]]
    1.22  
    1.23 -
    1.24  * Next
    1.25    The worm can see and hear, but it can't feel the world or
    1.26    itself. Next post, I'll give the worm a [[./touch.org][sense of touch]].
     2.1 --- a/org/touch.org	Mon Feb 13 08:20:25 2012 -0700
     2.2 +++ b/org/touch.org	Mon Feb 13 20:19:34 2012 -0700
     2.3 @@ -615,6 +615,10 @@
     2.4        background main-view touch targets))))
     2.5  #+end_src
     2.6  
     2.7 +#+begin_src sh :results silent
     2.8 +cd /home/r/proj/cortex/render/touch-cube/
     2.9 +ffmpeg -r 60 -i out/%07d.png -b:v 9000k -c:v libtheora basic-touch.ogg
    2.10 +#+end_src
    2.11  
    2.12  * Adding Touch to the Worm
    2.13  
    2.14 @@ -626,7 +630,9 @@
    2.15  
    2.16  (cortex.import/mega-import-jme3)
    2.17  
    2.18 -(defn test-touch []
    2.19 +(defn test-touch 
    2.20 +  ([] (test-touch false))
    2.21 +([record?]
    2.22    (let [the-worm (doto (worm) (body!))
    2.23          touch (touch! the-worm)
    2.24          touch-display (view-touch)]
    2.25 @@ -634,14 +640,25 @@
    2.26             standard-debug-controls
    2.27             
    2.28             (fn [world]
    2.29 +             (if record? 
    2.30 +               (Capture/captureVideo 
    2.31 +                 world
    2.32 +                 (File. "/home/r/proj/cortex/render/worm-touch/main-view/")))
    2.33               (speed-up world)
    2.34               (light-up-everything world))
    2.35  
    2.36             (fn [world tpf]
    2.37               (touch-display 
    2.38 -              (map #(% (.getRootNode world)) touch))))))
    2.39 +              (map #(% (.getRootNode world)) touch)
    2.40 +(if record? 
    2.41 +(File. "/home/r/proj/cortex/render/worm-touch/touch/"))
    2.42 +
    2.43 +)))))
    2.44  #+end_src
    2.45  
    2.46 +
    2.47 +
    2.48 +
    2.49  * Headers 
    2.50  
    2.51  #+name: touch-header