Reputation: 2086
I have played with ThreeJS a little in the past and am on a new project trying to setup hotspots in a panoramic. I remember using the camera dolly: http://davidpaulrosser.github.io/threejs-camera-dolly/ to get a nice visual of camera locations, but has anyone worked out one that would let you get the xyz coordinates if for instance on this ThreeJS example http://threejs.org/examples/css3d_panorama.html you wanted to place a hotspot on the road.
It could use the same thing as the dat gui that the camera dolly uses, or be a ball you drag around that reports it's location.
Upvotes: 1
Views: 991
Reputation: 148
So you just want to be able to convert from a panoramic image to 3d location, so you can save something there and render it later? Something like this will give you the location you need..
https://jsfiddle.net/mz7Lv9dt/1 (edit: fixed a typo)
The part that probably interests you is here:
var raycaster = new THREE.Raycaster();
raycaster.setFromCamera( uv, cam );
return raycaster.intersectObjects( objects );
Drag the green ball around to get its location (always set to unit length of one)
If I totally answered wrong let me know.
Upvotes: 2