# Local Rotation

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

## Recommended Posts

My questions have been answered thanks.

##### Share on other sites

Have a look at the thread  https://community.secondlife.com/t5/LSL-Scripting/Rotation-Math-Global-to-Local/td-p/2953989 on page 2 of this subforum, somebody has already asked a very similar question about global to local rotations, and also about rezzing objects which must then assume rotations dependant on the rezzer prim's rotation. Also have a look at "I...Hate...Rotations" further down the same page, because it is even more appropriate to your question.

In your snippet above, by the way, you have written a vector following the PRIM_ROT_LOCAL specifier, but it should be a quaternion. The wiki reference on llEuler2Rot() will give you some pointers to the way to convert between degrees/radians and quaternions.

##### Share on other sites

I don't really understand what you're trying to do here.

Assuming that the i in your fragment is great than 1 (that is, you're trying to move a child prim) then PRIM_POS_LOCAL and PRIM_ROT_LOCAL are the position and rotation local to root prim of the object.   so PRIM_POS_LOCAL in your fragment would mean "in exactly the same place as the root prim" -- i.e. not offset from it at all.   PRIM_POS_LOCAL,<1.0,0.0,0.0> would mean "one metre along the root prim's positive x axis (that is, the axis you see when you have local ruler set in the editor).   PRIM_ROT_LOCAL <0,0,0> will give you an error, since it expects a rotation, not a vector, and I'm really not sure what you're trying to do there.

If you can post the script here, we can probably make sense of it for you, but at the moment it's just a guessing game.   I can't visualise at all what you want to do.