Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Radar showing distance and DIRECTION

Christif Vaher
Registered User
Join date: 24 Jun 2008
Posts: 51
07-21-2008 13:45
Alright I understand the basics behind a simple radar showing the distance from av to av, but I am having a bit of an issue working out how to get the direction. As in AV1 has the radar script and is looking due North. AV2 is 20m away to the due East.

Can someone point me in the right direction ? Something that would allow me to calculate direction using llSensor or some other function ?
Anthony Hocken
Registered User
Join date: 16 Apr 2006
Posts: 121
07-21-2008 14:29
Take the position of you and the avatar detected, discard the Z axis of both because you wont need that, so just use the X and Y. Use trigonometry to calculate the angle (llAsin or llAtan2), then convert that to labels "North" etc.
_____________________
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
07-21-2008 15:26
Take a look at this thread: /54/cd/265026/1.html
Hewee Zetkin made a two liner that does the trick:)
_____________________
From Studio Dora