YOUR CREATIONS & GUIDES


Ryzom Database https://ryzom.silenda.de/

if i understand moniq correctly i did thesame or similar for bunny maps. my way does not take into relation of world coords, only region map coords.

i already spoke to selene but for anyone else,
example for future reference (made up numbers):

desert coords are :
15000.00(left) by 24000.00(right)
-24000.00(top) by -27000.00(bottom)

i changed the negative values to positive to ease the math
so for the y axis 24000.00(top) by 27000.00(bottom)

to get X and Y in a way to makes drawing it easier as a grid/canvas/layer i grab the difference so i get a (topleft = 0) for easier handling instaid of 15000 as a starting value.
x = 24000.00 - 15000.00 = 9000
y = 27000.00 - 24000.00 = 3000
now:
0.00(topleft) by 9000.00(topright)
0.00(topleft) by 3000.00(bottomleft)
or 9000x3000 as resolution

for a mark placement i switched over to percentages to get it to match any image resolution, to scale it to any image size.
example (<landmark type="0" x="18161.26" y="-25510.39" title="Exce Oil?"/>)
x calculated as:
100 / 9000 * (18161.26 - 15000.00) = 35.125111111111111111111111111111%
100 / 9000 to get 1coord% then * how far away from the start
so the mark would be at that % on the x axis, then i did the same for the y axis

pretend the clean desert jpg or png is 600x400. i then did:
ResultX = 600 / 100 * 35.125111111111111111111111111111
add: ResultX - (size-of-icon-width.png / 2) for centering on icon instaid of topleft of icon

ResultX = 210.75066666666666666666666666667 pixels on the width of the image

do thesame for Y values.



--- im sure theres an easier way, or better way, whatever i did it like this.

---

Show topic
Last visit Friday, 26 April 04:06:13 UTC
P_:

powered by ryzom-api