Mercurial > cortex
diff org/touch.org @ 430:5205535237fb
fix skew in self-organizing-touch, work on thesis.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 22 Mar 2014 16:10:34 -0400 |
parents | 4f5a5d5f1613 |
children | 763d13f77e03 |
line wrap: on
line diff
1.1 --- a/org/touch.org Fri Mar 21 20:56:56 2014 -0400 1.2 +++ b/org/touch.org Sat Mar 22 16:10:34 2014 -0400 1.3 @@ -78,7 +78,7 @@ 1.4 To simulate touch there are three conceptual steps. For each solid 1.5 object in the creature, you first have to get UV image and scale 1.6 parameter which define the position and length of the feelers. Then, 1.7 -you use the triangles which compose the mesh and the UV data stored in 1.8 +you use the triangles which comprise the mesh and the UV data stored in 1.9 the mesh to determine the world-space position and orientation of each 1.10 feeler. Then once every frame, update these positions and orientations 1.11 to match the current position and orientation of the object, and use 1.12 @@ -136,7 +136,7 @@ 1.13 A =Mesh= is composed of =Triangles=, and each =Triangle= has three 1.14 vertices which have coordinates in world space and UV space. 1.15 1.16 -Here, =triangles= gets all the world-space triangles which compose a 1.17 +Here, =triangles= gets all the world-space triangles which comprise a 1.18 mesh, while =pixel-triangles= gets those same triangles expressed in 1.19 pixel coordinates (which are UV coordinates scaled to fit the height 1.20 and width of the UV image). 1.21 @@ -152,7 +152,7 @@ 1.22 (.getTriangle (.getMesh geo) triangle-index scratch) scratch))) 1.23 1.24 (defn triangles 1.25 - "Return a sequence of all the Triangles which compose a given 1.26 + "Return a sequence of all the Triangles which comprise a given 1.27 Geometry." 1.28 [#^Geometry geo] 1.29 (map (partial triangle geo) (range (.getTriangleCount (.getMesh geo))))) 1.30 @@ -240,7 +240,7 @@ 1.31 [#^Triangle t] 1.32 (let [mat (Matrix4f.) 1.33 [vert-1 vert-2 vert-3] 1.34 - ((comp vec map) #(.get t %) (range 3)) 1.35 + (mapv #(.get t %) (range 3)) 1.36 unit-normal (do (.calculateNormal t)(.getNormal t)) 1.37 vertices [vert-1 vert-2 vert-3 unit-normal]] 1.38 (dorun