Open prozessor13 opened 2 years ago
Sounds interesting! This package is fairly old and might not be up to date with security and other issues. Since this is basically a single method of around 20 lines I would consider simply writing the method in here at maplibre: https://github.com/substack/ray-triangle-intersection/blob/master/index.js I hope we have the relevant math function that are referenced there in our code already.
Can this problem be the source of the fact that the marker and the point on the terrain looks slightly moved aside: This is how it look in 2D:
what is the difference of the 2 markers? symbol-layer & maplibregl.Marker?
Yes, one is an html object and the other is part of the canvas.
Assigned L bounty. Link to parent Bounty: https://github.com/maplibre/maplibre/issues/189
Can you check whether some of the supposed rounding errors are actually fixed by #2772? There was a minor mistake in the elevation logic.
I suspect it's responsible for https://github.com/maplibre/maplibre-gl-js/issues/1596#issuecomment-1252864823
currently screen-pixel to geo-coordinate transormation is done via a hidden framebuffer, which contains RGB-encoded geo-coordinates. But aspecially in heavy terrain this has rounding-errors, so i propose an improvement:
https://www.npmjs.com/package/ray-triangle-intersection