diff org/vision.org @ 188:22548d48cc85

added debug for vision
author Robert McIntyre <rlm@mit.edu>
date Sat, 04 Feb 2012 10:00:37 -0700
parents 04a39e6bb695
children facc2ef3fe5c
line wrap: on
line diff
     1.1 --- a/org/vision.org	Sat Feb 04 09:42:19 2012 -0700
     1.2 +++ b/org/vision.org	Sat Feb 04 10:00:37 2012 -0700
     1.3 @@ -237,6 +237,20 @@
     1.4     (for [eye (eyes creature)]
     1.5       (vision-fn creature eye))))
     1.6  
     1.7 +(defvar 
     1.8 +  view-vision
     1.9 +  (view-sense
    1.10 +   (fn 
    1.11 +     [[coords sensor-data]]
    1.12 +     (let [image (points->image coords)]
    1.13 +       (dorun
    1.14 +        (for [i (range (count coords))]
    1.15 +          (.setRGB image ((coords i) 0) ((coords i) 1)
    1.16 +                   (sensor-data i))))
    1.17 +       image)))
    1.18 +  "Creates a function which accepts visual sensor-data and displays it
    1.19 +   to the screen.")
    1.20 +
    1.21  #+end_src
    1.22  
    1.23