tentone/geo-three

如何通过鼠标简单快速获取 EPSG:900913[xyz]

Closed this issue · 2 comments

hi tentone :
cause i need add three obj by mouse ,i need get the xyz Coordinates. on map .on planar mode : i add a plan for moue get the Coordinates of map . then we cloude get W84 Coordinates quick buy mouse .like espg.io do . that we clould add obj where you like.i it's a simple think .but make a greate change. But there is one small regret : on terrain mode we cloud not get the heightinfo.

const geometry = new THREE.PlaneGeometry(0.4e8,0.4e8,256,256);
const material = new THREE.MeshBasicMaterial( {color: 0xff0000,wireframe:true, side: THREE.DoubleSide} );
const plane = new THREE.Mesh( geometry, material );
plane.rotateX(Math.PI/ 2);
scene.add( plane );

If we can get elevation information, it will be more better. Do you have any suggestions?

image

Hello

By using on the CPU generated height tiles method and raycasting you can obtain the exact coordinates of the surface that you are interacting with.

Check here for example on how to use the raycaster tool in three.js https://threejs.org/docs/#api/en/core/Raycaster

Thank a lot

Cheers

thank's very much tentone .
The effect is much better!!!