tentone / geo-three

Tile based geographic world map visualization library for threejs
https://tentone.github.io/geo-three/docs/
MIT License
699 stars 112 forks source link

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

Closed fzw2408 closed 2 years ago

fzw2408 commented 2 years ago

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

tentone commented 2 years ago

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

fzw2408 commented 2 years ago

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