If the prim's starting rotation is <0, anything, 0> it works, but that's the only case.
CODE
...
rotation yRot = llEuler2Rot( <0, 15 * DEG_TO_RAD, 0> );
vector pivotPoint = xStartPoint(currentPos, currentRot, size.x);
rotation newRot = yRot * currentRot; // compute local rotation
vector newPos = pivotPoint + ((currentPos - pivotPoint) * yRot);
llSetPrimitiveParams([PRIM_POSITION, newPos, PRIM_ROTATION, newRot]);
The pivot point is definitely correct. I'm sure the problem is this line...
CODE
vector newPos = pivotPoint + ((currentPos - pivotPoint) * yRot);
I'm guessing that yRot should be changed to account for the prim's rotation. But since I really don't understand the math, I haven't figured out how to solve my problem. I've tried a couple things that were just wrong. Or my guess could just be way off base.
Can someone help? Also, can someone explain what it means to multiply a vector by a rotation ?
Thanks!