Mercurial > cortex
comparison org/touch.org @ 241:f2e583be8584
saving progress...
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sun, 12 Feb 2012 13:30:42 -0700 |
parents | 6961377c4554 |
children | a7f26a074071 |
comparison
equal
deleted
inserted
replaced
240:6961377c4554 | 241:f2e583be8584 |
---|---|
248 (mapcat (fn [transform coords] | 248 (mapcat (fn [transform coords] |
249 (map #(.mult transform (->vector3f %)) coords)) | 249 (map #(.mult transform (->vector3f %)) coords)) |
250 transforms (feeler-pixel-coords geo image)))) | 250 transforms (feeler-pixel-coords geo image)))) |
251 | 251 |
252 (defn feeler-tips [#^Geometry geo image] | 252 (defn feeler-tips [#^Geometry geo image] |
253 (let [origins (feeler-origins geo image)] | 253 (let [origins (feeler-origins geo image) |
254 ( | 254 normals |
255 (map | |
256 (fn [triangle] | |
257 (.calculateNormal triangle) | |
258 (.clone (.getNormal triangle))) | |
259 (map ->triangle (triangles geo)))] | |
260 (map #(.add %1 %2) origins normals))) | |
261 | |
262 (defn touch-topology [#^Geometry geo image] | |
263 (collapse (feeler-pixel-coords geo image))) | |
255 | 264 |
256 ) | |
257 | |
258 | |
259 | 265 |
260 (defn sensors-in-triangle | 266 (defn sensors-in-triangle |
261 "Locate the touch sensors in the triangle, returning a map of their | 267 "Locate the touch sensors in the triangle, returning a map of their |
262 UV and geometry-relative coordinates." | 268 UV and geometry-relative coordinates." |
263 [image mesh tri-index] | 269 [image mesh tri-index] |