Q:
How to convert from Mumble to Map API Coords?
See this thread: https://forum-en.gw2archive.eu/forum/community/api/Event-Details-API-location-coordinates/2262330
or the TL;DR version over here: https://github.com/codemasher/gw2api-tools/blob/master/examples/gw2location.php#L209
(edited by smiley.1438)
See this thread: https://forum-en.gw2archive.eu/forum/community/api/Event-Details-API-location-coordinates/2262330
or the TL;DR version over here: https://github.com/codemasher/gw2api-tools/blob/master/examples/gw2location.php#L209
MY EYES!!! THEY’RE BLEEDING OUT MY SKULL!!!
See this thread: https://forum-en.gw2archive.eu/forum/community/api/Event-Details-API-location-coordinates/2262330
or the TL;DR version over here: https://github.com/codemasher/gw2api-tools/blob/master/examples/gw2location.php#L209
MY EYES!!! THEY’RE BLEEDING OUT MY SKULL!!!
Brain-melting, eh?
Brain melting indeed. I converted it over and the X coordinates work fine, but my Y coordinates seem to still be off, so to continue my “Mrot Boru” waypoint example, the map has the following values:
map_rect: [[-39936,-30720],[43008,33792]],
continent_rect: [[5888,14464],[9344,17152]],
So I calculate the Y:
= $cr[0][1]+($cr[1][1]-$cr[0][1])*(1-($p[1]-$mr[0][1])/($mr[1][1]-$mr[0][1]))
=14464+(17152-14464)*(1-(2090-(-30720))/(33792-(-30720)))
=15784.91667
But the JSON states the Y should be 16914.8.
Did I mess something up in the conversion of the Y portion of the function?
Thanks!
(edited by Negative Zero.3718)
Ok, so my first hunch about using the Z value from the mumble feed was correct and I should be using that value to caculate the Y coordinate on the 2D map. Once I switch to that value, all the equations work out.
Thanks for your help.