diff org/touch.org @ 227:2a7f57e7efdb

working on touch.org
author Robert McIntyre <rlm@mit.edu>
date Sat, 11 Feb 2012 14:12:17 -0700
parents e5db1d2ff9a8
children 0589c35f04f2
line wrap: on
line diff
     1.1 --- a/org/touch.org	Sat Feb 11 12:53:18 2012 -0700
     1.2 +++ b/org/touch.org	Sat Feb 11 14:12:17 2012 -0700
     1.3 @@ -17,7 +17,7 @@
     1.4  
     1.5  (defn triangles
     1.6    "Return a sequence of all the Triangles which compose a given
     1.7 -  Geometry." 
     1.8 +   Geometry." 
     1.9    [#^Geometry geom]
    1.10    (let
    1.11        [mesh (.getMesh geom)
    1.12 @@ -63,7 +63,7 @@
    1.13    (if-let [image-path (meta-data obj "touch")]
    1.14      (load-image image-path)))
    1.15  
    1.16 -(defn triangle
    1.17 +(defn mesh-triangle
    1.18    "Get the triangle specified by triangle-index from the mesh within
    1.19    bounds."
    1.20    [#^Mesh mesh triangle-index]
    1.21 @@ -80,7 +80,7 @@
    1.22      (vec indices)))
    1.23  
    1.24  (defn vertex-UV-coord
    1.25 -  "Get the uv-coordinates of the vertex named by vertex-index"
    1.26 +  "Get the UV-coordinates of the vertex named by vertex-index"
    1.27    [#^Mesh mesh vertex-index]
    1.28    (let [UV-buffer
    1.29          (.getData
    1.30 @@ -91,7 +91,7 @@
    1.31       (.get UV-buffer (+ 1 (* vertex-index 2)))]))
    1.32  
    1.33  (defn triangle-UV-coord
    1.34 -  "Get the uv-cooridnates of the triangle's verticies."
    1.35 +  "Get the UV-cooridnates of the triangle's verticies."
    1.36    [#^Mesh mesh width height triangle-index]
    1.37    (map (fn [[u v]] (vector (* width u) (* height v)))
    1.38         (map (partial vertex-UV-coord mesh)
    1.39 @@ -200,7 +200,7 @@
    1.40                  (white-coordinates image bounds))
    1.41          UV->geometry (triangle-transformation
    1.42                        cutout-triangle
    1.43 -                      (triangle mesh tri-index))
    1.44 +                      (mesh-triangle mesh tri-index))
    1.45          geometry-sensor-coords
    1.46          (map (fn [[u v]] (.mult UV->geometry (Vector3f. u v 0)))
    1.47               UV-sensor-coords)]