Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Rez in the right place?

Lennard Lopez
Registered User
Join date: 9 Oct 2007
Posts: 52
12-31-2008 01:28
Hello,

I want to rez a couple of pose balls above a couch. The rotation is correct, but the placement is not. When I turn the couch 180 degrees they are not on the correct place relative to the couch. How can I solve that?????

CODE

default{
touch_start(integer a){
string MyObject=llGetInventoryName(INVENTORY_OBJECT ,0);
vector MyPos = llGetPos() + <0.423,-0.292, 0.62>;
rotation MyRotation=llGetLocalRot()*llEuler2Rot(< 0, 0, 90> * DEG_TO_RAD);
vector MySpeed = llGetVel();
llRezAtRoot(MyObject, MyPos, MySpeed, MyRotation, 0);
}
}
Zaine Swords
Registered User
Join date: 26 Nov 2008
Posts: 47
12-31-2008 02:22
it looks like your problem is on the line where it says

vector MyPos = llGetPos() + <0.423,-0.292, 0.62>;

the numbers you have it set on are telling it where it should be and no other place.
i cant remeber what else you should put there but i hope that helps out a little.
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
12-31-2008 02:30
The offset should be rotated:
vector MyPos = llGetPos() + <0.423,-0.292, 0.62>*llEuler2Rot(< 0, 0, 90> * DEG_TO_RAD);
(offset and rotation taken from the sample program)
_____________________
From Studio Dora
Lennard Lopez
Registered User
Join date: 9 Oct 2007
Posts: 52
12-31-2008 03:38
Thanks. That helped me. Your solution was not completely correct. I had to multiply the pos with MyRotation.

CODE

default{
touch_start(integer a) {
string MyObject=llGetInventoryName(INVENTORY_OBJECT ,0);
rotation MyRotation=llGetLocalRot()*llEuler2Rot(< 0, 0, 90> * DEG_TO_RAD);
vector MyPos = llGetPos() + <-0.468,0.168, 0.62>*MyRotation;
llRezAtRoot(MyObject, MyPos, ZERO_VECTOR, MyRotation, 0);
}
}


I replaced the velocity by ZERO_VECTOR. It's a really slow couch.