# HG changeset patch
# User Robert McIntyre
# Date 1329189574 25200
# Node ID f1a74d23e7e49e0041ede18873917d63cccaa46a
# Parent e9bce4f722b171085ac7a6368e28a5dee6924fe2
added video generation code for touch
diff -r e9bce4f722b1 -r f1a74d23e7e4 org/hearing.org
--- a/org/hearing.org Mon Feb 13 08:20:25 2012 -0700
+++ b/org/hearing.org Mon Feb 13 20:19:34 2012 -0700
@@ -950,7 +950,6 @@
#+end_src
* Testing Hearing
-
** Advanced Java Example
I wrote a test case in Java that demonstrates the use of the Java
@@ -1083,7 +1082,6 @@
sound it hears beomes fainter. This shows the 3D localization of
sound in this world.
-
#+end_html
*** Creating the Ear Video
@@ -1169,7 +1167,6 @@
#+html:
- [[http://hg.bortreb.com ][source-repository]]
-
* Next
The worm can see and hear, but it can't feel the world or
itself. Next post, I'll give the worm a [[./touch.org][sense of touch]].
diff -r e9bce4f722b1 -r f1a74d23e7e4 org/touch.org
--- a/org/touch.org Mon Feb 13 08:20:25 2012 -0700
+++ b/org/touch.org Mon Feb 13 20:19:34 2012 -0700
@@ -615,6 +615,10 @@
background main-view touch targets))))
#+end_src
+#+begin_src sh :results silent
+cd /home/r/proj/cortex/render/touch-cube/
+ffmpeg -r 60 -i out/%07d.png -b:v 9000k -c:v libtheora basic-touch.ogg
+#+end_src
* Adding Touch to the Worm
@@ -626,7 +630,9 @@
(cortex.import/mega-import-jme3)
-(defn test-touch []
+(defn test-touch
+ ([] (test-touch false))
+([record?]
(let [the-worm (doto (worm) (body!))
touch (touch! the-worm)
touch-display (view-touch)]
@@ -634,14 +640,25 @@
standard-debug-controls
(fn [world]
+ (if record?
+ (Capture/captureVideo
+ world
+ (File. "/home/r/proj/cortex/render/worm-touch/main-view/")))
(speed-up world)
(light-up-everything world))
(fn [world tpf]
(touch-display
- (map #(% (.getRootNode world)) touch))))))
+ (map #(% (.getRootNode world)) touch)
+(if record?
+(File. "/home/r/proj/cortex/render/worm-touch/touch/"))
+
+)))))
#+end_src
+
+
+
* Headers
#+name: touch-header