PDA

View Full Version : map coords


zabbix
22.12.2005, 17:05
nooblet question: how to translate client coords (/loc) to region coords?
ie 355353 21236 -3732 => 22-24

thanks :roll:

filrip
22.12.2005, 18:18
all cube have the same size in X & Y (z does not change the region)
and its 32768.

Each 32768, increase the X region (16... 17 ... 18...) same for Y

So, with a division modulo function, you can know where you are

zabbix
22.12.2005, 18:23
k
thanks

hr
22.12.2005, 19:47
$geo_x=20+($game_x-$game_x%32768)/32768;
$geo_y=18+($game_y-$game_y%32768)/32768;