tentone / geo-three

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

There's some bug, when i use lat/lon to locate on sphere earth. #76

Open FengFengmomo opened 3 months ago

FengFengmomo commented 3 months ago

Hi! there. when i use UnitsUtils.datumsToVector( 45.993553258799736,90.14134050768502); but i finally find that it have offset, just look like below. please help! @tentone @cmurphy23 image

FengFengmomo commented 3 months ago

i have try UnitsUtils.datumsToSpherical() on plane map, and it is correct.

FengFengmomo commented 3 months ago

As use @cmurphy23 shader code, there ara a gap(just modify some code to show it),i think that's why localtion is lower than origin at longtitude! And may there are some methods to fix it, i'll try or could you privide some idea? image

FengFengmomo commented 3 months ago

when i use 6378137 as earth radius , it will close to real location, and i have read cesium fromDegrees method , it's earth radius use readius_a and radius_b as default. may be this is a key to solve issue.

tentone commented 3 months ago

The texture offset is something that we need to fix, that is causing some deviation.

But the main problem is how we are calculating the coordinates, the correct way to do it is to assume earth to be an ellipse instead of considering it to be a sphere (wich is what we are doing currently).

We have already declared in code the ellipsis radius

image

The current datumsToVector() method generates a spherical oriented vector