# HG changeset patch # User Robert McIntyre # Date 1329421731 25200 # Node ID d1206b11ae2d34faf65daa4e382ff642d3a07ed5 # Parent 1eed471e2ebf0846db5a33187394536f3ac27020 creating final video diff -r 1eed471e2ebf -r d1206b11ae2d assets/Models/test-creature/hand.blend Binary file assets/Models/test-creature/hand.blend has changed diff -r 1eed471e2ebf -r d1206b11ae2d org/integration.org --- a/org/integration.org Thu Feb 16 11:04:22 2012 -0700 +++ b/org/integration.org Thu Feb 16 12:48:51 2012 -0700 @@ -31,6 +31,19 @@ (def output-base (File. "/home/r/proj/cortex/render/hand")) + +;; Let the hand fall palm-up + +;; it curls its phalanges, starting with the pinky. + +;; it lets these fall back down? + +;; block falls down onto the hand, accompanied by a sound. The block +;; can be seen by the hand's eye. + +;; hand FORCEFULLY catapults the block so that it hits the camera. + + (defn motor-control-program "Create a function which will execute the motor script" [muscle-positions @@ -83,20 +96,55 @@ (def full 9001) ;; the systax here is [keyframe body-part force] (def wiggle-each-finger-tip - [[200 :pointer-3-f full] - [200 :pointer-3-f 40] + [[300 :pointer-3-f 50] + [400 :middle-3-f full] - [401 :middle-3-f 40] + [401 :middle-3-f 50] [600 :ring-3-f full] [601 :ring-3-f 40] [800 :pinky-3-f full] - [801 :pinky-3-f 40]]) + [801 :pinky-3-f 50] + [1300 :pointer-1-f full] + [1300 :pointer-2-f full] + [1300 :pointer-3-f 0] + [1289 :middle-1-f full] + [1289 :middle-2-f full] + [1289 :middle-3-f 0] + + [1310 :pointer-1-f 0] + [1310 :pointer-2-f 0] + [1310 :pointer-3-f 0] + [1310 :middle-1-f 0] + [1310 :middle-2-f 0] + [1310 :middle-3-f 0] + + + + ]) + +(defn gen-summon-ball [] + (let [wait (atom 20)] + (fn [world] + (if (= 0 (swap! wait dec)) + (let [brick + (box 0.8 0.8 0.8 :mass 0.05 + :position (Vector3f. 0 0 0.5) + :color (ColorRGBA/Red))] + + (.addControl + brick + (proxy [AbstractControl] [] + (controlUpdate [tpf] + (println-repl (.getWorldTranslation brick))) + (controlRender [_ _]))) + (add-element world brick)))))) + (def control-list [ @@ -141,7 +189,8 @@ "Sounds/pure.wav" false) creature (doto (load-blender-model hand) (body!)) - + + summon-ball (gen-summon-ball) ;;;;;;;;;;;; Sensors/Effectors ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;touch (touch! creature) ;;touch-display (view-touch) @@ -175,6 +224,9 @@ (fn [world] (.setTimer world (RatchetTimer. 60)) + (position-camera + world (Vector3f. 7.7101235, 6.3628435, -14.15047) + (Quaternion. 0.3644328, -0.2558489, 0.104854375, 0.8892332)) (light-up-everything world) (enable-debug world) (add-camera! world @@ -182,13 +234,14 @@ (.getChild (.getChild creature "eyes") "eye")) (comp (view-image) BufferedImage!)) - (speed-up world)) + (speed-up world) + ) (fn [world tpf] ;;(prop-display (prop)) ;;(touch-display (map #(% (.getRootNode world)) touch)) ;;(vision-display (map #(% world) vision)) ;;(hearing-display (map #(% world) hearing)) - + (summon-ball world) ;;(muscle-display (control-script muscles) ;;) diff -r 1eed471e2ebf -r d1206b11ae2d org/util.org --- a/org/util.org Thu Feb 16 11:04:22 2012 -0700 +++ b/org/util.org Thu Feb 16 12:48:51 2012 -0700 @@ -113,13 +113,10 @@ (defn position-camera "Change the position of the in-world camera." - ([world position direction up] + [world #^Vector3f position #^Quaternion rotation] (doto (.getCamera world) - (.setLocation ) - (.lookAt direction up))) - ([world position direction] - (position-camera - world position direction Vector3f/UNIT_Y))) + (.setLocation position) + (.setRotation rotation))) (defn enable-debug "Turn on debug wireframes for every object in this simulation." @@ -219,7 +216,7 @@ #+end_src #+results: util -: #'cortex.util/apply-map +: #'cortex.util/runonce *** Creating Basic Shapes