Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llRezObject question

Mod Faulkner
Registered User
Join date: 11 Oct 2005
Posts: 187
03-23-2007 10:19
This is probably very simple but I am not getting it. I have an object at position X that rezzes a physical object from its contents. I want the newly rezzed object to move toward position Y. I thought that using llRotBetween(x,y) as the rotation value would do this, but that does not appear to be the case. I am guessing that the velocity value is directional, but I am unsure how to work a rotation into the vector. Any hints will be appreciated.

Mod
Mod Faulkner
Registered User
Join date: 11 Oct 2005
Posts: 187
More information
03-25-2007 00:03
Since I got no response to my initial question, maybe if I give more details it will help. I want touch the prim that rezzes the object, have it detect my location through llDetectedPos and use that vector to rezz the object with its forward axis facing me.
Tyann Toll
It went... where?!
Join date: 17 Dec 2006
Posts: 37
03-26-2007 07:27
Im not sure I can help directly, except to mention that I've had some trouble with rezzing objects. I've had a bit of a dig on the LSL wiki, and you might be looking for the llRotLookAt function? The lsl wiki link is http://www.lslwiki.net/lslwiki/wakka.php?wakka=llRotLookAt

But, I've been unable to find a function that would give you the location of the avatar. A workaround might be to make it look at a prim you are wearing? But its more likely that I cant work out how to read the avatar's current position.

Once you have that, llRotLookAt is your friend, I think.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
03-26-2007 08:24
From: Tyann Toll
Im not sure I can help directly, except to mention that I've had some trouble with rezzing objects. I've had a bit of a dig on the LSL wiki, and you might be looking for the llRotLookAt function? The lsl wiki link is http://www.lslwiki.net/lslwiki/wakka.php?wakka=llRotLookAt

But, I've been unable to find a function that would give you the location of the avatar. A workaround might be to make it look at a prim you are wearing? But its more likely that I cant work out how to read the avatar's current position.

Once you have that, llRotLookAt is your friend, I think.


You could get the position of the avatar using a sensor, i..e rez, fire sensor, in the sensor event perform the rotation. But will it always be the owner it needs to look at though?
Mod Faulkner
Registered User
Join date: 11 Oct 2005
Posts: 187
More info
03-26-2007 10:48
I can get the location using llDetectedPos. What I have not figured out is how to take that vector and use it to set the rotation for the llRezObject function.
Dominguez Brentano
Registered User
Join date: 20 Apr 2006
Posts: 87
03-26-2007 12:09
wouldnt it be easier to have a script in the rezed object do the detecting, and then adjust its own position and motion to that which you desire once it is spawned?
Valradica Vanek
Registered User
Join date: 1 Aug 2006
Posts: 78
rotation
03-26-2007 13:13
Once the sensing object is touched, use the llDetected(0) to determine where the avatar is. Calculate the vector from the object to the Avatar and use

rotation rot = llEuler2Rot(<vector>;);

to calculate the rotation required. Make sure you are using all global coordinates.
Then when you use the

llRezObject (name, velocity, rotation, startparam);

enter that rotation and use the scaled vector as the velocity to what you want. The object will rez facing the avatar and will move toward it at that velocity.

this should work - hope this is helpful
Mod Faulkner
Registered User
Join date: 11 Oct 2005
Posts: 187
Thanks
03-26-2007 16:34
Valradica,I will give your advice a try once I get home. And yes Dominguez, that would be easier, but if it can be done in the rez process it will be quicker.

Mod
Mod Faulkner
Registered User
Join date: 11 Oct 2005
Posts: 187
Still not getting it.
03-28-2007 07:35
I thought that using llRotBetween(a,b) would be what I need for the vector, but thats a rotation. I tried a couple of other things but they did not work either. What function(s) do I use to get the vector a and b?

Mod