# HG changeset patch
# User Robert McIntyre <rlm@mit.edu>
# Date 1326600944 25200
# Node ID 85ee8bb80edf1a6b4a3783e6dd5e299bb36dc45c
# Parent  7eeb940bcbc84f3b4e3c12a8b984c37443a22488
can now visuliaze touch data

diff -r 7eeb940bcbc8 -r 85ee8bb80edf org/test-creature.org
--- a/org/test-creature.org	Sat Jan 14 20:44:13 2012 -0700
+++ b/org/test-creature.org	Sat Jan 14 21:15:44 2012 -0700
@@ -8,8 +8,8 @@
 
 
 * objectives
- - [ ] get an overall bitmap-like image for touch
- - [ ] write code to visuliaze this bitmap
+ - [X] get an overall bitmap-like image for touch
+ - [X] write code to visuliaze this bitmap
  - [ ] directly change the UV-pixels to show touch sensor activation
  - [ ] write an explination for why b&w bitmaps for senses is appropiate
  - [ ] clean up touch code and write visulazation test
@@ -747,7 +747,21 @@
        (filter #(isa? (class %) Geometry)
                (node-seq pieces))))
 
-    
+(defn debug-window
+  "creates function that offers a debug view of sensor data"
+  []
+  (let [vi (view-image)]
+    (fn 
+      [[coords sensor-data]]
+      (let [image (points->image coords)]
+        (dorun
+         (for [i (range (count coords))]
+           (.setRGB image ((coords i) 0) ((coords i) 1)
+                    ({0 -16777216
+                      1 -1} (sensor-data i)))))
+        (vi image)))))
+
+
 (defn all-names []
   (concat 
    (re-split #"\n" (slurp (file-str