Jump to content

Rez on touch - How to adjust rez position?


Sadvhi
 Share

You are about to reply to a thread that has been inactive for 2389 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I have a rezz on touch script and need to change the position where the item is rezzed. I would like it to rezz directly over the prim (right now it seems to be rezzing quite far to the left side of the prim). I'm assuming the following is what I need to adjust:

llGetPos() + <-0.5,0,0>, <0,0,0>, <0,0,0,0>, 1);

 

Link to comment
Share on other sites

It's rezzing to the left because you told it to.  Assuming that you want it to rez a half meter above the center of your rezzer, you should have told it llGetPos() + <0.0,0.0,0.5>  (assuming that your rezzer is sitting with its Z axis pointed up).  Remember, <x, y, z>.

Link to comment
Share on other sites

Read the wiki article on llRezAtRoot.

Briefly, the llGetPos()+<some vector> means "at the position of the rezzer plus the offset indicated by the vector."    Two points to watch.   First, the offset can't be more than 10 metres away from the rezzer.  Second, the script uses region coordinates unless told otherwise.   That is, you're saying "rez 2 metres to the North/South/East/West" of the object.    Most of the time, you want to use the rezzer's own frame of reference -- that is, n metres  "in front of me" or "to my left" or whatever.    Fortunately, that's easy to do -- simply write  llGetPos()+<offset * llGetRot().   

Note that the order of operations is important -- the * makes it look like a multiplication but it's not.   In rotation algebra, offset * llGetRot() and llGetRot() * offset mean two very different things. 

The  second vector -- <0,0,0> in your example -- you can ignore.  It's the velocity of the object, and it's relevant only if you're rezzing stuff like arrows or bullets.

The third vector, with 4 elements -- <0,0,0,0> in your example -- is the rotation at which the object should be oriented when it rezzes.   As above, the raw rotation means "facing North/South?East/West, and rotation * llGetRot() means "facing towards me/away from me/to my left" etc.

Link to comment
Share on other sites

Thank you so much! I appreciate your going into such depth in explaining and clarifying this for me - I never even understood what the numbers are for until now. After implementing your advice, the items are now rezzing directly above the prim:) I'm tremendously grateful to each of you for taking the time to help me resolve the issue.

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2389 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...