|
Nero Draper
Registered User
Join date: 15 Nov 2005
Posts: 5
|
06-01-2006 19:53
Hey everyone I'm trying to script a 3d avatar mapper, like when someone comes in range a icon apears on a little map that shows thier virtual pos.. I have it all working except one thing, It only displays thier position correctly if the object it pointing west... See I want to wear this object, but i want it to show the avatars positions relaitive to my rotation, like if i rotate i want all the little icons to change thier position to make it relaitive to my position, if thier on the left of me it will show them on the left on the radar hud. Any advice? Thank's in advanced!!
|
|
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
|
06-01-2006 22:55
you have to offset your rotation to theirs
so if in a perfect world you were facing north (0) and they would be 90 degrees to your east
lets say in SL your facing 10 degrees (slightly ne) 10+90 = 100
the rest is fairly resonable .. alot of the times you wont even have to deal with the exact math
|
|
Nero Draper
Registered User
Join date: 15 Nov 2005
Posts: 5
|
06-02-2006 10:10
Hmm. See all the parts are linked, there are 16 little markers that split up a list in a linkedmessage and then one main prim. How would I go about offseting thier position relitiave to mine? I would need to send a linkedmessage with some values in it to make them change thier position based on my facing... If I rotate the whole linkset it it gives me the same result as wearing it and rotating it, which make it stay the same. I also plan on adding some more buttons to it so rotating the whole linkset is not a option. Any adeas? I would some how need to take my rotation then do some math and output a position...
|
|
Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
|
06-03-2006 12:41
vector mapPos = llDetectedPos(i) * llGetRootRotation(); Ought to do it for both normally and attached, to do it for a link set you'll need to scale down the distance but I assume you've done that already so replace llDetectedPos(i) with the position yo want on the map.
_____________________
Computer (Mac Pro): 2 x Quad Core 3.2ghz Xeon 10gb DDR2 800mhz FB-DIMMS 4 x 750gb, 32mb cache hard-drives (RAID-0/striped) NVidia GeForce 8800GT (512mb)
|