03-06-2006 16:50
Lets say I have a board on the ground. The length runs along the X axis. A ball is placed at one end (not linked) and I want it to move along the X axis to the other end. I can easily do this by changing the X positon.

Now here is where I have a problem. Lets say I rotate the board on the Z axis by a random amount. Now to move it from one end of the board to the other I have to calculate the X and the Y positions all along the length. Is there an easy way to do this?

Is there a way to move something along one of the Local axis of a prim?


Edit: I figgured it out sorry for leaving this.

I'll leave what I found just in case any one is interested.

CODE

vector new_position = <1.5, 0, 0 >; // move 1.5 on the X axis
vector A; // hold final results for move position
rotation B; // to rotate facing same direction

A = llGetPos() + new_position * llGetRot(); // Calculate for local axis movement
B = llGetRootRotation(); // if you want the prim rotated to the same direction

llSetPos(A);
llSetRot(B);