Talk:Viewer coordinate frames
How to calculate the local coordinate of a linked prim from a script in the root is not documented in the wiki. The problem being that the linked prim position is given in region coordinates and setting the location of a linked prim needs to be in local coordinates.
It is anti-intuitive (you subtract the root position from the prim position), but like this: <lsl>key keyObj = llGetLinkKey(i); list a = llGetObjectDetails(keyObj,([OBJECT_POS])); // returns region coordinate vector localp = llList2Vector(a,0) - llGetRootPosition();
// and later you can use this to set another prim to that location using: llSetLinkPrimitiveParams(i,[PRIM_POSITION,localp]); //expects local coordinate</lsl> -- Wood Wheels