# HG changeset patch # User Robert McIntyre # Date 1329013941 25200 # Node ID e29dd0024a9e2956a5efc47946e18223968cf77c # Parent f9b7d674aed84bf7d1ec67244e2bd25ec5b38979 reorganized touch diff -r f9b7d674aed8 -r e29dd0024a9e org/touch.org --- a/org/touch.org Sat Feb 11 19:28:36 2012 -0700 +++ b/org/touch.org Sat Feb 11 19:32:21 2012 -0700 @@ -52,6 +52,7 @@ stored under the key "scale". If the pixel is gray then the resultant hair length is linearly interpolated between 0 and =scale=. +#+name: meta-data #+begin_src clojure (defn tactile-sensor-profile "Return the touch-sensor distribution image in BufferedImage format, @@ -78,6 +79,7 @@ =(triangle-UV-coord)= returns the the UV coordinates of the verticies of a triangle. +#+name: triangles-1 #+begin_src clojure (defn triangles "Return a sequence of all the Triangles which compose a given @@ -137,6 +139,7 @@ functions make this easy. If these classes implemented =Iterable= then this code would not be necessary. Hopefully they will in the future. +#+name: triangles-2 #+begin_src clojure (defn triangle-seq [#^Triangle tri] [(.get1 tri) (.get2 tri) (.get3 tri)]) @@ -177,6 +180,7 @@ for translating any coordinate within the UV triangle to the cooresponding coordinate in the XYZ triangle. +#+name: triangles-3 #+begin_src clojure (defn triangle->matrix4f "Converts the triangle into a 4x4 matrix: The first three columns @@ -214,6 +218,7 @@ =(inside-triangle?)=, which determines whether a point is inside a triangle in 2D UV-space. +#+name: triangles-4 #+begin_src clojure (defn convex-bounds "Returns the smallest square containing the given vertices, as a @@ -256,6 +261,7 @@ location of each touch sensor from pixel coordinates to UV-coordinates and XYZ-coordinates. +#+name: sensors #+begin_src clojure (defn sensors-in-triangle "Locate the touch sensors in the triangle, returning a map of their @@ -309,6 +315,7 @@ The "hairs" are actually rays which extend from a point on a =Triangle= in the =Mesh= normal to the =Triangle's= surface. +#+name: rays #+begin_src clojure (defn get-ray-origin "Return the origin which a Ray would have to have to be in the exact @@ -335,7 +342,7 @@ * Skin Creation - +#+name: kernel #+begin_src clojure (defn touch-fn "Returns a function which returns tactile sensory data when called @@ -393,7 +400,7 @@ #+end_src * Visualizing Touch - +#+name: visualization #+begin_src clojure (defn view-touch "Creates a function which accepts a list of touch sensor-data and @@ -411,6 +418,8 @@ #+end_src * Headers + +#+name: touch-header #+begin_src clojure (ns cortex.touch "Simulate the sense of touch in jMonkeyEngine3. Enables any Geometry @@ -434,7 +443,16 @@ * COMMENT Code Generation #+begin_src clojure :tangle ../src/cortex/touch.clj -<> +<> +<> +<> +<> +<> +<> +<> +<> +<> +<> #+end_src #+begin_src clojure :tangle ../src/cortex/test/touch.clj