javascript - three.js get mouse coortinates on texture -


i want create interactive panorama one:

http://mrdoob.github.io/three.js/examples/webgl_panorama_equirectangular.html

but want let user interact it.

is possible coordinates texture on mouse move create 3d image map three.js?

thanks!

check this: translating mouse location object coordinates

when found triangle ray intersects, can gather triangles vertices 3d coordinates , uvs. there have enough data calculate uv position intersection point.

pseudo-code:

x0 = mouse.x; y0 = mouse.y; vec3 samplepoint = unproject(x0, y0);  // returns (x, y, near-plane-z) coords ray.origin = camera.position; ray.direction = samplepoint - camera.position; var trianglecomplexobj = check_for_intersections( scene, ray );  // returns triangle, it's vertices , uv , 3d coord , intersection coord calulateuv( trianglecomplexobj , trianglecomplexobj.intersectionpoint ); 

it's maybe bit complex understand should trick. hope helps.


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -