changeset 459:a86555b02916

changes from laptop.
author Robert McIntyre <rlm@mit.edu>
date Thu, 27 Mar 2014 17:56:26 -0400
parents 42ddfe406c0a
children 763d13f77e03
files org/depth-map.org org/ideas.org org/util.org
diffstat 3 files changed, 28 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/org/depth-map.org	Tue Jun 11 07:13:42 2013 -0400
     1.2 +++ b/org/depth-map.org	Thu Mar 27 17:56:26 2014 -0400
     1.3 @@ -13,7 +13,7 @@
     1.4  (cortex.import/mega-import-jme3)
     1.5  
     1.6  (defn convert-pixel-to-ray
     1.7 -  [camera x y]
     1.8 +  [camera ray x y]
     1.9    (let [pixel-arrow
    1.10          (.getWorldCoordinates
    1.11           camera
    1.12 @@ -26,7 +26,6 @@
    1.13      (set-ray ray Matrix4f/IDENTITY (.getLocation camera)
    1.14               pixel-arrow) ray))
    1.15  
    1.16 -
    1.17  (defn generate-depth-map-points
    1.18    "Generate a data structure representating the depth of the first
    1.19    object to collide with a ray from the camera's current position."
    1.20 @@ -35,17 +34,34 @@
    1.21          height (.getHeight camera)
    1.22          pixels (for [x (range width) y (range height)]
    1.23                   [x y])
    1.24 -        
    1.25 +        temp-ray (Ray.)
    1.26          depths
    1.27          (for [[x y] pixels]
    1.28 -          (let [ray (convert-pixel-to-ray camera x y)
    1.29 +          (let [ray (convert-pixel-to-ray camera temp-ray x y)
    1.30                  results (CollisionResults.)]
    1.31              (.collideWith world ray results)
    1.32 -            (.getDistance (.getClosestCollision results))))]
    1.33 +            (if-let [closest (.getClosestCollision results)]
    1.34 +              (.hashCode (.getGeometry closest)) 0)))]
    1.35 +
    1.36      (zipmap pixels depths)))
    1.37  
    1.38  (defn test-world []
    1.39    (nodify [(floor*) (brick-wall*)]))
    1.40  
    1.41 -(defn run-depth-map-test []
    1.42 +(import com.aurellem.capture.RatchetTimer)
    1.43 +
    1.44 +(defn depth-map-test []
    1.45 +  (let [the-world (test-world)]
    1.46 +    (world
    1.47 +     the-world
    1.48 +     ;;controls
    1.49 +     standard-debug-controls
    1.50 +     ;;init
    1.51 +     (fn [world]
    1.52 +       (let [timer (RatchetTimer. 60)]
    1.53 +         (.setTimer world timer)
    1.54 +         (display-dilated-time world timer)))
    1.55 +     ;; update
    1.56 +     no-op)))
    1.57 +
    1.58  #+end_src
    1.59 \ No newline at end of file
     2.1 --- a/org/ideas.org	Tue Jun 11 07:13:42 2013 -0400
     2.2 +++ b/org/ideas.org	Thu Mar 27 17:56:26 2014 -0400
     2.3 @@ -2,6 +2,11 @@
     2.4  
     2.5  * Brainstorming different sensors and effectors.
     2.6  
     2.7 +** toys 
     2.8 +Make toys in the world with "docking points," which would attach
     2.9 +together in physically stable ways. Could make analogs to legos,
    2.10 +tinker toys, and lincoln logs. 
    2.11 +
    2.12  Every sense that we have should have an effector that changes what
    2.13  that sense (or others who have that sense) experiences.
    2.14  
     3.1 --- a/org/util.org	Tue Jun 11 07:13:42 2013 -0400
     3.2 +++ b/org/util.org	Thu Mar 27 17:56:26 2014 -0400
     3.3 @@ -59,6 +59,7 @@
     3.4    "Import ALL the jme classes. For REPL use."
     3.5    []
     3.6    (dorun
     3.7 +   (import com.aurellem.capture.IsoTimer)
     3.8     (map (comp permissive-import symbol) (jme-class-names))))
     3.9  #+end_src  
    3.10