Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Sim Radar Staying in a box.

Nyx Alsop
Registered User
Join date: 14 Dec 2008
Posts: 252
11-18-2009 11:21
I'm making a sim radar that will be a mini version of the current sim, a prim will rezz for each person and need to update based on their position.

How can I scale this down to say a 1meter box?

What would I do to edit the position of the actual person, to be a cut down to be relative in a size of say 1 meter box version.

Say there position is:

<99.697280, 133.924100, 20.351980>

I want to rez a prim to represent them in a 1 meter box,

so

Rez a root

But then what do I do to this value <99.697280, 133.924100, 20.351980> to make it work for the 1 meter box.

Thanks
Rime Wirsing
Color me gone
Join date: 31 Dec 2008
Posts: 345
11-18-2009 11:54
This might give you a start...



Rime
Nyx Alsop
Registered User
Join date: 14 Dec 2008
Posts: 252
11-18-2009 18:46
Oddly,

The 3D doesn't seem to work from there?

So still looking for some help
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
11-18-2009 19:21
i was doing a mapped hud radar for the emerald viewer. it had several layered prims with an alpha texture with a numbered dot. i put it in the center and then in gimp i offset it so a quarter of it would be at each corner so when the texture was offset on the hud, the dot would be centered on the correct position, i'm pretty sure the calculation i used was the avatar's position divided by 128. so your result would be < 0.778885, 1.04628203125, 0.15899984375 >. for texture offsetting, the Z axis wouldn't matter because it's ignored. but for a radar box, you might need to add an offset for the box size.
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
11-18-2009 19:45
From: Nyx Alsop
Oddly,

The 3D doesn't seem to work from there?

So still looking for some help

That IS odd. Jesse's 3D Radar is a beautiful script. You did create two objects, right? The display sphere and the tiny one that the script rezzes inside every time it detects an av?
_____________________
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-19-2009 07:34
Yeah but the balls positon were never updated based on the avatar, whitch is what I'm lookin for.

Does anyone have any example code that does this? or any more tips.

Really struggling with the scaling down part.

If it could just not leave the box it's rezzed from that would be awesome.
Indeterminate Schism
Registered User
Join date: 24 May 2008
Posts: 236
11-20-2009 07:09
This is the long way around but should be easy to understand.

1. Find the avatar's position as a fraction of a 256m sim:

vector Pos = llDetectedPos(x);
Pos.x /= 255.0; // 0.0m to 255.0m
Pos.y /= 255.0; // becomes 0.0 to 1.0
Pos.z /= 255.0; // Altitudes over 255m are automatically > 1.0

2. Adjust relative to the middle of the sim/rezzer

Pos -= <0.5, 0.5, 0.5>; // now -0.5 to +0.5. (And higher for altitudes above 255m)

3. Scale for your rezzer land-prim

vector Me = llGetScale();
Pos.x *= Me.x; // EG; on a 2m-cube rezzer
Pos.y *= Me.y; // -0.5 to +0.5
Pos.z *= Me.z; // becomes -1.0m to +1.0m. Don't stretch it for higher altitudes.

4. Rotate for your rezzer land-prim

Pos *= llGetRot(); // ... possibly, but since I ALWAYS mess-up rotations at first, check it!

5. And finally, position for your land-prim

Pos += llGetPos();
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
11-20-2009 08:02
From: Nyx Alsop
Yeah but the balls positon were never updated based on the avatar, whitch is what I'm lookin for.

I don't understand what you mean by "the balls positon were never updated based on the avatar." That's exactly what Jesse's script does, and it does it beautifully.
_____________________
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-20-2009 08:18
Sorry,

All sorted now, yay.