Hi,
is there a way to figure out the name of the ADT of the current region?
thx in advance,
dehe
Hi,
is there a way to figure out the name of the ADT of the current region?
thx in advance,
dehe
Not sure if you can do this directly, but you can figure it out by your map and position as the ADTs are fixed-width at 533 + 1/3
Do you really mean height, as in the Z axis? Because that value will not affect your current ADT. Only your north / south position does.
ADTs have nothing to do with 3D and you should learn to use the proper words for the things you mean.
The coordinates in WoW are following:
X
Y
Z
Converted to recast (the format you calculate in which ADT the location (based on wow-x and wow-y) is):
X = -Y
Y = Z
Z = -X
As C#-Code:
PHP Code:
public static Vector3D ToRecast(this Vector3D v)
{
return new Vector3D(-v.Y, v.Z, -v.X);
}
public static Vector3D ToWoW(this Vector3D v)
{
return new Vector3D(-v.Z, -v.X, v.Y);
}
If you're now able to calculate on which Tile the location on the X-Axis is, then you won't have a problem to do the same with the Y-Axis.
í'm sorry, but my english isnt that good. There is a World map. the adts are being connected together, with their golbal position being part of the filename, which makes it possible to use this for calculation - there is anouther thread about this in the forum. The reason i need this is that i cant transfer map-coordinates to world-coordinate. map coordinates are the coordinates u see on the minimap, they do range from 0 to 100. world coordinates are coordinates like those you are talking about, but its not a problem with conversion of world-coordinates to recast/detour (wheres the tip you gave me might become handy later on).
yes - theoretically. practically, the same formula gives out correct x-values, and wrong y-values (speaking in map-coordinates).If you're now able to calculate on which Tile the location on the X-Axis is, then you won't have a problem to do the same with the Y-Axis.
Here's the formula i'm currently using (the one without using adt-names):
val is the x or y value.
Code:float absCoordX = ((float)531733 / (float)997) * val + ((float)531733 / (float)997); float WorldKoord=-absCoordX+((float)35182399/(float)1999); return WorldKoord;
Sorry, but what exactly is your aim? You want to convert the map-coordinates (range: 0-100) to world-coordinates?
Are you working with recast or do you want to extract the minimap-files?
Where do you have the strange value like "1999", "997", "531733" or "35182399" from?
Hi,
I its just to simple to say it simple - well, im dumb - so:
I want to use WoW-Head coordniatas (map-coordinates, range0-100) and convert them into world coordinates to use them with the CTM struct to go to that NPC.
the strange values do come from an online calculator which does (dont know the english term - "Formeln Umstellen").
The original formulas are working with the 533.333 and so on.
Edith:
thats really strange, because i modified that 3d-viewer in the latest release of WoWMapper to export the data, and it's returning x, y and z values.ADTs have nothing to do with 3D
Last edited by dehe; 07-04-2012 at 10:53 AM.
Well but this is a complete different situation!
The map coordinates which you can access ingame are related to the top left corner of the current area. Therefor do you have to read the WorldMapArea DBC, get the current zone and then calculate the x and y-scale between the top-left and the bottom-right corner. Like this will you be able to multiply the local x and y-coordinates which range from 0-100 with the scale and add them to the top-left corner. And voilá, you'll have the x and the y coordinates as world coordinates.
You'll fail when you try to use only CTM to get there, because there will be many obstacles in your way and the biggest problem. You don't have a method to get the z-coordinate!
You can use the following methods to get the z-coordinate: Use the Objectmanager (if the NPC is close), Injection (TraceLine) and Detour (Mesh).