Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Converting local and region coordinates

Nicola Mondrian
Registered User
Join date: 10 Jun 2005
Posts: 11
05-01-2006 08:09
Hi!

Is there a formula with which you can convert regional coordinates (of a sim) to local coordinates?

Them sims coordinates start in a corner of the sim while the coordinates of a child prim relative to the parent start in the parents center.

I want to make a map that has a dot moving over the map when the map moves around in a sim.

Now if the sim and the map both ahev the same ratio of length and width it should be possible to create a mathematical formula to convert the coordinates shouldn't it?

Is there anyone who knows how to do that?



Thanks,


Nicola
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
05-01-2006 10:28
What about making the map's root prim be a small (and maybe invisible) prim at the corner of the map? Then the formula should be pretty simple, because your local position will be from the corner of the map, not the center, so all you need to do is scale it. So if it's a 1:100 map, just get the region coordinates and divide by 100, and that's your local coordinates.

Or something like that :)
Geuis Dassin
Filming Path creator
Join date: 3 May 2006
Posts: 565
05-11-2006 15:22
found this in another thread.

http://secondlife.com/badgeo/wakka.php?wakka=GlobalCoordinate
Static Sprocket
Registered User
Join date: 10 Feb 2006
Posts: 157
05-11-2006 15:44
I did something along these lines before. Here is a brief outline of what I did:

Map Object: 2.56m x 2.56m
Translation: (llGetPos() / 100) - <1.28, 1.18, 0.0>

Map Object: 5.12m x 5.12m
Translation: (llGetPos() / 50) - <2.56, 2.56, 0.0>

Both of these will then need a verticle Z compensation so that the target point will be "above" the map object. So just add <0.0, 0.0, .25> or whatever you feel is appropriate for your object.
_____________________