Hi bax and Paolo,
I´m creating a GPS inside my application and to show where things are we´ve decided to get the .map to get the x,y position of the tiles that we need.
What´s exactly the logic used to tranform ix in coordinates (ex: 21486 in a 100x80 map)? It´s coordinate is 86,54,2.
We need the 86,54,0 tile, but we don´t know it, we just have the 21486.
we are subtracting 8000 (each layer Z), so this tile is in z = 2.
then we divide the result (5486) by 100 (the width), result = 54,86 (the y position = 54)
Then we get the 0,86 and multiply by 100 (width), and get the x = 86
Is that correct? It will work for all tiles?
thanks
How to get x,y,z position from .map ix?
How to get x,y,z position from .map ix?
Fabio Colombini
Brazil
Brazil
Re: How to get x,y,z position from .map ix?
ix counter starts from the lower level (z=0) and from the tile in the upper, left corner (x=0, y=0), moving right and down.
So your math is right.
So your math is right.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Return to “OpenSpace v2 discussions and help”
Who is online
Users browsing this forum: No registered users and 22 guests