comparison org/skin.org @ 8:522cf85fdb57

getting there!
author Robert McIntyre <rlm@mit.edu>
date Sun, 23 Oct 2011 00:59:22 -0700
parents 9ccfbcbed90a
children 7d0c0282c3a7
comparison
equal deleted inserted replaced
7:9ccfbcbed90a 8:522cf85fdb57
101 101
102 (defn get-ray-origin 102 (defn get-ray-origin
103 [geom tri] 103 [geom tri]
104 (let [new (Vector3f.)] 104 (let [new (Vector3f.)]
105 (.calculateCenter tri) 105 (.calculateCenter tri)
106 (.localToWorld geom (.get tri 1) new) 106 (.localToWorld geom (.getCenter tri) new)
107 new)) 107 new))
108 108
109 (defn get-ray-direction 109 (defn get-ray-direction
110 [geom tri] 110 [geom tri]
111 (let [new (Vector3f.)] 111 (let [new (Vector3f.)]
112 (.calculateNormal tri) 112 (.calculateNormal tri)
113
113 (.localToWorld geom (.getNormal tri) new) 114 (.localToWorld geom (.getNormal tri) new)
114 new 115 (.subtract new (get-ray-origin geom tri))
115 Vector3f/UNIT_Y)) 116
117 ;;Vector3f/UNIT_Y
118 ))
116 119
117 (defn ray-origin-debug 120 (defn ray-origin-debug
118 [ray] 121 [ray]
119 (make-shape 122 (make-shape
120 (assoc base-shape 123 (assoc base-shape