Commit 61ec551
committed
Ray casting gives texture intersection in uv coordinates
Mesh.js raycast method is updated to calculate intersection point in uv
coordinates. The calculus is done in the new inner method
textureIntersection and added to the object returned as the uv property.
Texture.js has a new public method, transformUv, that convert the
coordinates from uv (range 0 to 1) to the real texture coordinates. The
input parameter is modified on output. Useful to have the intersection
point in texture coordinates.
There is no example in this commit because I only have example with
canvas, no with plain image.1 parent 7c3e8c6 commit 61ec551
2 files changed
Lines changed: 102 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| |||
107 | 111 | | |
108 | 112 | | |
109 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
110 | 129 | | |
111 | 130 | | |
112 | 131 | | |
| |||
152 | 171 | | |
153 | 172 | | |
154 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
155 | 184 | | |
156 | 185 | | |
157 | 186 | | |
| |||
162 | 191 | | |
163 | 192 | | |
164 | 193 | | |
| 194 | + | |
165 | 195 | | |
166 | 196 | | |
167 | 197 | | |
| |||
194 | 224 | | |
195 | 225 | | |
196 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
197 | 237 | | |
198 | 238 | | |
199 | 239 | | |
| |||
208 | 248 | | |
209 | 249 | | |
210 | 250 | | |
| 251 | + | |
211 | 252 | | |
212 | 253 | | |
213 | 254 | | |
| |||
282 | 323 | | |
283 | 324 | | |
284 | 325 | | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
285 | 336 | | |
286 | 337 | | |
287 | 338 | | |
| |||
292 | 343 | | |
293 | 344 | | |
294 | 345 | | |
| 346 | + | |
295 | 347 | | |
296 | 348 | | |
297 | 349 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
188 | 238 | | |
189 | 239 | | |
190 | 240 | | |
| |||
0 commit comments