|
Sofia Weir
Registered User
Join date: 5 Feb 2007
Posts: 26
|
02-16-2009 03:22
Hello all I am creating a poseball which is activated via a hud worn by the Avatar. What i need to do is being able to rez the ball in a specific location relevant to the position and the orientation of the avatar, for example just behind him/her or directly to his/her the left hand side. The trick is that in order to achieve that i need to know where the avatar is facing at the moment of the rez, because in order for the ball to be directly behind the Av, the AV needs to look at a specific direction, otherwise it rezes wrong!. Does anybody has any sudjestions? (PS. the llLookAt doesnt work! i need some kind of vector result but I didnt have success so far..) Thanx a lot 
|
|
Yumi Murakami
DoIt!AttachTheEarOfACat!
Join date: 27 Sep 2005
Posts: 6,860
|
02-16-2009 04:46
I'm not quite clear on what you mean. Are you saying that you want to rez the poseball relative to the avatar? Or are you saying that you want to rotate the avatar to a certain place before rezzing the poseball? If the answer is the latter then there is no way to do it.
If the answer is the former, then you can do it. Get the avatar's position and rotation with either llSetPos or llGetObjectDetails (depending on whether the object that's going to rez the poseball is going to be worn by the avatar or not). Create a vector indicating the offset from the avatar you want the item to be rezzed with. Multiply it by the avatar's rotation, then add the avatar's current location.
|
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
02-16-2009 04:51
llRezObject( "ballname", llGetPos()+ < 1.0, 0.0, 0.0 >*llGetRot(), ZERO_VECTOR, llGetRot(), 0 ); Will rez the ball named "ballname" one meter in front of your AV with the same rotation as your AV. No matter how your AV is turned this will always rez in front of it. 
_____________________
From Studio Dora
|