Mercurial > cortex
diff org/integration.org @ 297:d1206b11ae2d
creating final video
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Thu, 16 Feb 2012 12:48:51 -0700 |
parents | 1eed471e2ebf |
children | 85f3ff3e3f26 |
line wrap: on
line diff
1.1 --- a/org/integration.org Thu Feb 16 11:04:22 2012 -0700 1.2 +++ b/org/integration.org Thu Feb 16 12:48:51 2012 -0700 1.3 @@ -31,6 +31,19 @@ 1.4 1.5 (def output-base (File. "/home/r/proj/cortex/render/hand")) 1.6 1.7 + 1.8 +;; Let the hand fall palm-up 1.9 + 1.10 +;; it curls its phalanges, starting with the pinky. 1.11 + 1.12 +;; it lets these fall back down? 1.13 + 1.14 +;; block falls down onto the hand, accompanied by a sound. The block 1.15 +;; can be seen by the hand's eye. 1.16 + 1.17 +;; hand FORCEFULLY catapults the block so that it hits the camera. 1.18 + 1.19 + 1.20 (defn motor-control-program 1.21 "Create a function which will execute the motor script" 1.22 [muscle-positions 1.23 @@ -83,20 +96,55 @@ 1.24 (def full 9001) 1.25 ;; the systax here is [keyframe body-part force] 1.26 (def wiggle-each-finger-tip 1.27 - [[200 :pointer-3-f full] 1.28 - [200 :pointer-3-f 40] 1.29 + [[300 :pointer-3-f 50] 1.30 + 1.31 1.32 [400 :middle-3-f full] 1.33 - [401 :middle-3-f 40] 1.34 + [401 :middle-3-f 50] 1.35 1.36 [600 :ring-3-f full] 1.37 [601 :ring-3-f 40] 1.38 1.39 [800 :pinky-3-f full] 1.40 - [801 :pinky-3-f 40]]) 1.41 + [801 :pinky-3-f 50] 1.42 1.43 + [1300 :pointer-1-f full] 1.44 + [1300 :pointer-2-f full] 1.45 + [1300 :pointer-3-f 0] 1.46 1.47 + [1289 :middle-1-f full] 1.48 + [1289 :middle-2-f full] 1.49 + [1289 :middle-3-f 0] 1.50 + 1.51 + [1310 :pointer-1-f 0] 1.52 + [1310 :pointer-2-f 0] 1.53 + [1310 :pointer-3-f 0] 1.54 1.55 + [1310 :middle-1-f 0] 1.56 + [1310 :middle-2-f 0] 1.57 + [1310 :middle-3-f 0] 1.58 + 1.59 + 1.60 + 1.61 + ]) 1.62 + 1.63 +(defn gen-summon-ball [] 1.64 + (let [wait (atom 20)] 1.65 + (fn [world] 1.66 + (if (= 0 (swap! wait dec)) 1.67 + (let [brick 1.68 + (box 0.8 0.8 0.8 :mass 0.05 1.69 + :position (Vector3f. 0 0 0.5) 1.70 + :color (ColorRGBA/Red))] 1.71 + 1.72 + (.addControl 1.73 + brick 1.74 + (proxy [AbstractControl] [] 1.75 + (controlUpdate [tpf] 1.76 + (println-repl (.getWorldTranslation brick))) 1.77 + (controlRender [_ _]))) 1.78 + (add-element world brick)))))) 1.79 + 1.80 1.81 (def control-list 1.82 [ 1.83 @@ -141,7 +189,8 @@ 1.84 "Sounds/pure.wav" false) 1.85 creature (doto (load-blender-model hand) 1.86 (body!)) 1.87 - 1.88 + 1.89 + summon-ball (gen-summon-ball) 1.90 ;;;;;;;;;;;; Sensors/Effectors ;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1.91 ;;touch (touch! creature) 1.92 ;;touch-display (view-touch) 1.93 @@ -175,6 +224,9 @@ 1.94 1.95 (fn [world] 1.96 (.setTimer world (RatchetTimer. 60)) 1.97 + (position-camera 1.98 + world (Vector3f. 7.7101235, 6.3628435, -14.15047) 1.99 + (Quaternion. 0.3644328, -0.2558489, 0.104854375, 0.8892332)) 1.100 (light-up-everything world) 1.101 (enable-debug world) 1.102 (add-camera! world 1.103 @@ -182,13 +234,14 @@ 1.104 (.getChild 1.105 (.getChild creature "eyes") "eye")) 1.106 (comp (view-image) BufferedImage!)) 1.107 - (speed-up world)) 1.108 + (speed-up world) 1.109 + ) 1.110 (fn [world tpf] 1.111 ;;(prop-display (prop)) 1.112 ;;(touch-display (map #(% (.getRootNode world)) touch)) 1.113 ;;(vision-display (map #(% world) vision)) 1.114 ;;(hearing-display (map #(% world) hearing)) 1.115 - 1.116 + (summon-ball world) 1.117 ;;(muscle-display 1.118 (control-script muscles) 1.119 ;;)