diff org/test-creature.org @ 145:7a49b81ca1bf

finally got proprioception working to my satisfaction
author Robert McIntyre <rlm@mit.edu>
date Thu, 02 Feb 2012 12:49:11 -0700
parents d0f4b473ab4f
children 68226790d1fa
line wrap: on
line diff
     1.1 --- a/org/test-creature.org	Thu Feb 02 03:17:11 2012 -0700
     1.2 +++ b/org/test-creature.org	Thu Feb 02 12:49:11 2012 -0700
     1.3 @@ -1086,53 +1086,6 @@
     1.4         0xFF
     1.5         (.getRGB image x 0)))))
     1.6  
     1.7 -
     1.8 -(defn draw-sprite [image sprite x y color ]
     1.9 -  (dorun
    1.10 -   (for [[u v] sprite]
    1.11 -     (.setRGB image (+ u x) (+ v y) color))))
    1.12 -
    1.13 -(defn view-angle
    1.14 -  "create a debug view of an angle"
    1.15 -  [color]
    1.16 -  (let [image (BufferedImage. 50 50 BufferedImage/TYPE_INT_RGB)
    1.17 -        previous (atom [25 25])
    1.18 -        sprite [[0 0] [0 1]
    1.19 -                [0 -1] [-1 0] [1 0]]] 
    1.20 -    (fn [angle]
    1.21 -      (let [angle (float angle)]
    1.22 -        (let [position
    1.23 -              [(+ 25 (int (* 20 (Math/cos angle))))
    1.24 -               (+ 25 (int (* 20(Math/sin angle))))]]
    1.25 -          (draw-sprite image sprite (@previous 0) (@previous 1) 0x000000)
    1.26 -          (draw-sprite image sprite (position 0) (position 1) color)
    1.27 -          (reset! previous position))
    1.28 -        image))))
    1.29 -
    1.30 -(defn proprioception-debug-window
    1.31 -  []
    1.32 -  (let [yaw (view-angle 0xFF0000)
    1.33 -        roll (view-angle 0x00FF00)
    1.34 -        pitch (view-angle 0xFFFFFF)
    1.35 -        v-yaw (view-image)
    1.36 -        v-roll (view-image)
    1.37 -        v-pitch (view-image)
    1.38 -        ]
    1.39 -    (fn [prop-data]
    1.40 -      (dorun
    1.41 -       (map
    1.42 -        (fn [[y r p]]
    1.43 -          (v-yaw (yaw y))
    1.44 -          (v-roll (roll r))
    1.45 -          (v-pitch (pitch p)))
    1.46 -        prop-data)))))
    1.47 -
    1.48 -
    1.49 -
    1.50 -
    1.51 -
    1.52 -
    1.53 -
    1.54  (defn test-creature [thing]
    1.55    (let [x-axis
    1.56          (box 1 0.01 0.01 :physical? false :color ColorRGBA/Red)
    1.57 @@ -1190,7 +1143,7 @@
    1.58                     (comp (view-image) BufferedImage!))
    1.59            
    1.60            (add-eye world (.getCamera world) no-op)
    1.61 -          (set-gravity world (Vector3f. 0 0 0))
    1.62 +          ;;(set-gravity world (Vector3f. 0 0 0))
    1.63            ;;(com.aurellem.capture.Capture/captureVideo
    1.64            ;; world (file-str "/home/r/proj/ai-videos/hand"))
    1.65            ;;(.setTimer world (RatchetTimer. 60))