Negative Zero.3718:

I am trying to figure out how to convert the coordinates I am reading from the Mumble position to coordinates I can use with the map JSON APIs.

When I am standing at Mrot Boru Waypoint I get the following from Mumble:

X: 9759.99
Y: 2090.003
Z: -25029.63

The JSON for Mrot Boru is:

poi_id: 117,
name: "Mrot Boru Waypoint",
type: "waypoint",
floor: 1,
coord: [
7958.96,
16914.8
]

Based on how the values change when I move, I am guessing I need to look at the X and Z values, as Y seems to be vertical movement (jumping triggers only a change in Y).

Does anyone have a simple method to properly convert from the mumble coords to the map API coords?

Thanks!

smiley.1438:

See this thread: https://forum-en.guildwars2.com/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

Killer Rhino.6794:

MY EYES!!! THEY’RE BLEEDING OUT MY SKULL!!!

smiley.1438:

Brain-melting, eh?

Negative Zero.3718:

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!

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.