08-09-2007 19:45
Dearest community,

I wish to rotate a prim around an arbitrary point with an axis based on the prim's LOCAL rotation.

I recognize that the following code:
-------------------
rotation rot30X = llEuler2Rot(<30, 0,0> * DEG_TO_RAD ); // create a rotation constant, 30 degrees around the X axis
vector offset = <0, 1, 0>; // create an offset one meter in the global positive Y direction
vector rotatedOffset = offset * rot30X; // rotate the offset to get the motion caused by the rotations
vector newPos = llGetPos() + rotatedOffset; // move the prim position by the rotated offset amount
-------------------

Will displace the object in a rotated translation around a point 1 meter positive in the Y direction from the GLOBAL axis.

I wish code to do the same 1 meter offset in the Y direction around the prim's LOCAL axes, thus performing the rotation from the prim's perspective, regardless of how it was rotated in reference to the world to start with.

Any help would be appreciated.

With thanks,
NX Swindlehurst