Why does an object rez up in the air?
|
Nicoletta Lefevre
Registered User
Join date: 2 Nov 2008
Posts: 50
|
05-23-2009 23:42
I've had this happen with items I've bought, and now on a sculpt I made, it's the same thing...you rez it, and it's way high in the air.
Why does this happen and how do I fix it?
Thanks, Nic
|
Lightwave Valkyrie
Registered User
Join date: 30 Jan 2004
Posts: 666
|
05-24-2009 03:34
it happens with cut prims too has to do with collision box i use a script to move it down on_rez // on_res move down
vector down = <0,0,-0.517>; //distance to movedown use negative for down z axis
vector pos;
default { on_rez(integer start_param) { pos = llGetPos(); llSetPos(pos + down); }
} [\PHP]
_____________________
L$ is the root of all evil videos work! thanks SL 
|
Nicoletta Lefevre
Registered User
Join date: 2 Nov 2008
Posts: 50
|
05-24-2009 10:13
Oh, thank you!!!
Edit: works PERFECTLY!
|
Ponk Bing
fghfdds
Join date: 19 Mar 2007
Posts: 220
|
05-24-2009 12:58
I hadn't thought of that, nice script 
|
Talon Brown
Slacker Punk
Join date: 17 May 2006
Posts: 352
|
05-25-2009 01:26
Has anyone else tried that script when rezzing an object on a prim floor? It seems to drop it right down through the prim.
|
Nicoletta Lefevre
Registered User
Join date: 2 Nov 2008
Posts: 50
|
05-25-2009 01:34
From: Talon Brown Has anyone else tried that script when rezzing an object on a prim floor? It seems to drop it right down through the prim. I was rezzing on my work platform, which is basically a giant floor in the sky. Had no problem, although you do have to tinker with the value. Trial and error on that.
|
Talon Brown
Slacker Punk
Join date: 17 May 2006
Posts: 352
|
05-25-2009 01:47
It's interesting though, even when I rez an ordinary prim like a cube or a sphere (no script), it rezzes higher above the ground than it does above a flat prim surface. Makes it hard to find a value that works for both situations.
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
05-25-2009 05:55
From: Talon Brown It's interesting though, even when I rez an ordinary prim like a cube or a sphere (no script), it rezzes higher above the ground than it does above a flat prim surface. Makes it hard to find a value that works for both situations. Well, duh. The Z-value of -0.517 is quite arbitrary. It's simply a little more than half the thickness of a one meter prim. If you use something other than a 1m thick prim, of course you have to vary the Z value.
_____________________
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 
|
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
|
05-25-2009 07:30
Here's the slight variation I use on my furniture and other builds that need this sort of adjustment. It works perfectly on prim surfaces as well as on the ground, and has been tested to at least 3,000 Meters. You alter the "adjustHeight" variable to indicate how much to move the item up or down, in Meters, from where it rezzes initially. So for example if you used a cut cylinder for the bottom of a chair, and the cylinder was 1 M tall on the Z-axis, an adjustHeight value of -0.5 would move the linkset down 1/2 meter an instant after it rezzes, placing the chair at the midpoint of that cylinder
// adjust this height float adjustHeight = -0.2; // how much the position should be adjusted when the object is rezzed. (m) -
default { on_rez(integer x) { vector v = llGetPos (); v.z = v.z + adjustHeight; llSetPos(v); } }
_____________________
Sorry, LL won't let me tell you where I sell my textures and where I offer my services as a sim builder. Ask me in-world.
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
05-25-2009 07:49
If you don't like typing a new Z value every time you use the little script in a new object, you can always modify the script to calculate its own Z-value. So long as you haven't rotated your object so that its Z-axis is non-vertical, for example, this small modification works .... // on_res move down 1/2 of the prim's height (if its Z axis is vertical) default { on_rez(integer start_param) { vector primSize = llGetScale(); vector down = <0,0,-(primSize.z/2.0)>; vector pos = llGetPos(); llSetPos(pos + down); } }
ETA: Ha! Ceera beat me to it. Well, now you have two versions.... 
_____________________
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 
|
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
|
05-25-2009 09:16
Three versions, Rolig. Mine is closer to the original one posted, as it doesn't try to calculate the offset. The main advantage of mine is you only enter a scalar Z-value, and not an <x,y,z> vector, for the adjustment.
_____________________
Sorry, LL won't let me tell you where I sell my textures and where I offer my services as a sim builder. Ask me in-world.
|