Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Help With Working Out?

Nyx Alsop
Registered User
Join date: 14 Dec 2008
Posts: 252
11-28-2009 11:27
I'm creating a 2D radar(the balls move), I want it to work on local axes, so the radar can be turned around.

vector newPos - llDetectedPos(i);
vector ourCurrentPositionY = llGetLocalPos();
vector scaledDownPositionY = (newPos - ourCurrentPositionY) / (256 / 1);
vector finalPositionY = ourCurrentPositionY+scaledDownPositionY;

It's still working on the worlds axes, when I turn the 2d radar around.

How can I change this so the position will be local and when i turn the 2D board it works on the new local axes and not the worlds.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
11-28-2009 12:16
I think that

vector finalPositionY = ourCurrentPositionY+scaledDownPositionY* llGetRot();

will do it. Whenever you have a vector question, always consult http://wiki.secondlife.com/wiki/Rotation. That's what I do. :)
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Nyx Alsop
Registered User
Join date: 14 Dec 2008
Posts: 252
11-28-2009 13:55
I tried that and it did not worth, neither did llGetLocalRot()
Nyx Alsop
Registered User
Join date: 14 Dec 2008
Posts: 252
11-28-2009 14:07
Is there anyway to find out what local axes something currently facing?
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
11-28-2009 17:30
I've never really studied how it works, but you might find some good ideas in Jesse Barnett's 3-d radar script at http://wiki.secondlife.com/wiki/3D_Radar
Nyx Alsop
Registered User
Join date: 14 Dec 2008
Posts: 252
11-28-2009 18:10
No that works on region axes and with it being 3D doesn't do the thing mines struggling with.