Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Local Rotation of an Object

Zorphin Zadark
Registered User
Join date: 29 Nov 2008
Posts: 11
09-27-2009 19:35
Can somebody help me out with how to rotate an object around the local axis of the root prim?

llSetLocalRot() when used on the root prim has the same effect as llSetRot, ie rotates in the Region plane - I presume there is some way I can mutiply the current rotation by the rotation i want to apply, but i am getting my head messed up trying to figure it out ;) - basically I just want to rotate the entire object n degrees around the current local y axis of the root prim ... any help would be appreciated.

Thanks
ZZ
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
09-27-2009 20:10
You may be running afoul of SVC-93 (see the link below). In any case, the description of that defect may help you out.

http://jira.secondlife.com/browse/SVC-93
Zorphin Zadark
Registered User
Join date: 29 Nov 2008
Posts: 11
09-27-2009 20:45
Thanks for pointing me at that Hewee - it wasnt actually the issue I had, but it did make me aware of some interesting issues ... hmmmm ...

and, maybe thanks in part to that it got me thinking what I needed to do .. and I have now got something that appears to work ;)

Maybe those with a better grasp of Quaternian Math can tell me if this is really doing what I want, but I do seem to be able to manage to rotate the object around the root's y axis now with the following:

rotation myRot = llEuler2Rot(<0.0, 10.0, 0.0> * DEG_TO_RAD);
llSetRot(myRot * llGetRootRotation());

the effect I see certainly looks like what I was trying to achieve ;)
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
09-28-2009 02:09
From: Zorphin Zadark

rotation myRot = llEuler2Rot(<0.0, 10.0, 0.0> * DEG_TO_RAD);
llSetRot(myRot * llGetRootRotation());

the effect I see certainly looks like what I was trying to achieve ;)
You are right! this is the way you do it.
It is the general approach and will work for any value of 'myRot':)
_____________________
From Studio Dora
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
09-28-2009 02:55
From: Zorphin Zadark

rotation myRot = llEuler2Rot(<0.0, 10.0, 0.0> * DEG_TO_RAD);
llSetRot(myRot * llGetRootRotation());

the effect I see certainly looks like what I was trying to achieve ;)
You are right! this is the way you do it.
It is the general approach and will work for any value of 'myRot':)
_____________________
From Studio Dora