# HG changeset patch # User Robert McIntyre # Date 1327492488 25200 # Node ID 0efe6f04bc269388f088a6a0759f23f831d2cf19 # Parent 3d65633dd736677bad4e9a12cd4124beb5cda038 greatly enhanced touch sensitivity diff -r 3d65633dd736 -r 0efe6f04bc26 org/test-creature.org --- a/org/test-creature.org Tue Jan 24 18:20:57 2012 -0700 +++ b/org/test-creature.org Wed Jan 25 04:54:48 2012 -0700 @@ -9,29 +9,36 @@ * ideas ** have to get done before winston - - [ ] write an explination for why greyscale bitmaps for senses is appropiate - - [ ] muscle control - - [ ] proprioception sensor map in the style of the other senses - - [ ] enable greyscale bitmaps for touch + - [ ] write an explination for why greyscale bitmaps for senses is + appropiate -- 1/2 day + - [ ] muscle control -- day + - [ ] proprioception sensor map in the style of the other senses -- day - [ ] refactor integration code to distribute to each of the senses - - [ ] create video showing all the senses for Winston - - [ ] write summary for Winston - - [ ] project proposals for Winston - - [ ] send winston package + -- day + - [ ] create video showing all the senses for Winston -- 2 days + - [ ] write summary of project for Winston \ + - [ ] project proposals for Winston \ + - [ ] additional senses to be implemented for Winston | -- 2 days + - [ ] send Winston package / ** would be cool to get done before winston - - [ ] use sawfish to auto-tile sense windows - - [ ] sawfish keybinding to automatically delete all sense windows - - [ ] proof of concept C sense manipulation - - [ ] proof of concept GPU sense manipulation - - [ ] fourier view of sound - - [ ] directly change the UV-pixels to show sensor activation + - [X] enable greyscale bitmaps for touch -- 2 hours + - [X] use sawfish to auto-tile sense windows -- 6 hours + - [X] sawfish keybinding to automatically delete all sense windows + - [ ] directly change the UV-pixels to show sensor activation -- 2 + days + - [ ] proof of concept C sense manipulation -- 2 days + - [ ] proof of concept GPU sense manipulation -- week + - [ ] fourier view of sound -- 2 or 3 days + - [ ] dancing music generator ** don't have to get done before winston - - [ ] write tests for integration - - [ ] usertime/gametime clock HUD display - - [ ] find papers for each of the senses justifying my own representation - - [ ] show sensor maps in HUD display? + - [ ] write tests for integration -- 3 days + - [ ] usertime/gametime clock HUD display -- day + - [ ] find papers for each of the senses justifying my own + representation -- week + - [ ] show sensor maps in HUD display? -- 4 days + - [ ] show sensor maps in AWT display? -- 2 days * Intro @@ -629,11 +636,16 @@ (let [results (CollisionResults.)] (.collideWith node ray results) (let [touch-objects - (set - (filter #(not (= geo %)) - (map #(.getGeometry %) results)))] - (if (> (count touch-objects) 0) - 1 0)))))))))))) + (filter #(not (= geo (.getGeometry %))) + results)] + (- 255 + (if (empty? touch-objects) 255 + (rem + (int + (* 255 (/ (.getDistance + (first touch-objects)) limit))) + 256)))))))))))))) + (defn touch [#^Node pieces] (filter (comp not nil?) @@ -910,6 +922,11 @@ (do (println-repl "could not find joints node") []))] (assemble-creature model joints))) +(defn gray-scale [num] + (+ num + (bit-shift-left num 8) + (bit-shift-left num 16))) + (defn debug-window "creates function that offers a debug view of sensor data" [] @@ -920,8 +937,9 @@ (dorun (for [i (range (count coords))] (.setRGB image ((coords i) 0) ((coords i) 1) - ({0 0x000000 - 1 0xFFFFFF} (sensor-data i))))) + (gray-scale (sensor-data i))))) + + (vi image))))) (defn debug-vision-window @@ -949,10 +967,8 @@ (dorun (for [y (range height)] (let [raw-sensor (sensor-data x)] - (.setRGB image x y - (+ raw-sensor - (bit-shift-left raw-sensor 8) - (bit-shift-left raw-sensor 16)))))))) + (.setRGB image x y (gray-scale raw-sensor))))))) + (vi image)))))