changeset 109:c05d8d222166

ready to start touch UV maps with GIMP
author Robert McIntyre <rlm@mit.edu>
date Mon, 16 Jan 2012 03:19:15 -0700
parents 92b857b6145d
children f89f0b9ed2fe
files assets/Models/creature1/tip.png assets/Models/creature1/tip.xcf assets/Models/creature1/try-again.blend assets/Models/creature1/worm-2-UV-layout.png assets/Models/creature1/worm-2-UV-layout.svg org/test-creature.org
diffstat 6 files changed, 75 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
     1.1 Binary file assets/Models/creature1/tip.png has changed
     2.1 Binary file assets/Models/creature1/tip.xcf has changed
     3.1 Binary file assets/Models/creature1/try-again.blend has changed
     4.1 Binary file assets/Models/creature1/worm-2-UV-layout.png has changed
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/assets/Models/creature1/worm-2-UV-layout.svg	Mon Jan 16 03:19:15 2012 -0700
     5.3 @@ -0,0 +1,8 @@
     5.4 +<?xml version="1.0" standalone="no"?>
     5.5 +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
     5.6 +  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
     5.7 +<svg width="1024px" height="1024px" viewBox="0px 0px 1024px 1024px"
     5.8 +     xmlns="http://www.w3.org/2000/svg" version="1.1">
     5.9 +<desc>'try-again.blend', worm-2, (Blender 2.59 (sub 4))</desc>
    5.10 +
    5.11 +</svg>
     6.1 --- a/org/test-creature.org	Sun Jan 15 04:08:31 2012 -0700
     6.2 +++ b/org/test-creature.org	Mon Jan 16 03:19:15 2012 -0700
     6.3 @@ -628,7 +628,9 @@
     6.4  (defn enable-touch [#^Geometry geo]
     6.5    (let [feeler-coords (feeler-coordinates geo)
     6.6          tris (triangles geo)
     6.7 -        limit 0.1]
     6.8 +        limit 0.1
     6.9 +        ;;results (CollisionResults.)
    6.10 +        ]
    6.11      (fn [node]
    6.12        (let [sensor-origins 
    6.13              (map
    6.14 @@ -657,6 +659,8 @@
    6.15                    (if (> (count touch-objects) 0)
    6.16                      1 0)))))))))))
    6.17  
    6.18 +
    6.19 +
    6.20  (defn touch [#^Node pieces]
    6.21    (map enable-touch
    6.22         (filter #(isa? (class %) Geometry)
    6.23 @@ -704,12 +708,18 @@
    6.24       ;;(com.aurellem.capture.Capture/captureVideo
    6.25       ;; world (file-str "/home/r/proj/ai-videos/hand"))
    6.26       (.setTimer world (RatchetTimer. 60))
    6.27 -     ;;(speed-up world)
    6.28 +     (speed-up world)
    6.29       ;;(set-gravity world (Vector3f. 0 0 0))
    6.30       )
    6.31     (fn [world tpf]
    6.32 +     ;;(dorun 
    6.33 +     ;; (map #(%1 %2) touch-nerves (repeat (.getRootNode world))))
    6.34 +     
    6.35       (dorun
    6.36 -      (map #(%1 (%2 (.getRootNode world))) touch-debug-windows touch-nerves))
    6.37 +      (map #(%1 (%2 (.getRootNode world)))
    6.38 +           touch-debug-windows touch-nerves))
    6.39 +     
    6.40 +
    6.41       )
    6.42     ;;(let [timer (atom 0)]
    6.43     ;;  (fn [_ _]
    6.44 @@ -718,10 +728,63 @@
    6.45     ;;      (println-repl (float (/ @timer 60))))))
    6.46     )))
    6.47  
    6.48 +
    6.49 +
    6.50 +
    6.51 +
    6.52 +
    6.53 +
    6.54 +
    6.55 +
    6.56 +;;; experiments in collisions
    6.57 +
    6.58 +
    6.59 +
    6.60 +(defn collision-test []
    6.61 +  (let [a-radius 1 
    6.62 +        a-position (Vector3f. -0.25 3 0)
    6.63 +        b-radius 1
    6.64 +        b-position (Vector3f. 0.25 3 0)
    6.65 +
    6.66 +
    6.67 +        obj-a (box 1 1 1 :color ColorRGBA/Red
    6.68 +                      :position a-position
    6.69 +                      :physical? false)
    6.70 +        obj-b (box 1 1 1 :color ColorRGBA/Blue
    6.71 +                      :position b-position
    6.72 +                      :physical? false)
    6.73 +        node (nodify [obj-a obj-b])
    6.74 +        bounds-a (BoundingBox. a-position 1 1 1)
    6.75 +        bounds-b (BoundingBox. b-position 1 1 1)
    6.76 +        sim
    6.77 +        (world node
    6.78 +               {}
    6.79 +               no-op
    6.80 +               no-op)
    6.81 +
    6.82 +        ]
    6.83 +    (.setBound (.getMesh obj-a) bounds-a)
    6.84 +    (.updateBound (.getMesh obj-a))
    6.85 +
    6.86 +    
    6.87 +    (.setBound (.getMesh obj-b) bounds-b)
    6.88 +    (.updateBound (.getMesh obj-b))
    6.89 +
    6.90 +
    6.91 +
    6.92 +    (let [cr (CollisionResults.)]
    6.93 +      (.collideWith node bounds-a cr)
    6.94 +      [cr sim])
    6.95 +    
    6.96 +))
    6.97 +   
    6.98 +    
    6.99 +                         
   6.100 +  
   6.101  #+end_src
   6.102  
   6.103  #+results: body-1
   6.104 -: #'cortex.silly/tactile-coords
   6.105 +: #'cortex.silly/test-creature
   6.106  
   6.107  
   6.108  * COMMENT purgatory