Works like a charm if placed at some multiple of a 90 degree angle (0, 90, 180, 270, 360)
However, when placed at a 45 or other degree angle, and opened, it leaps over to the side, though off a bit from where it should be, and leaps out in front a fair bit.
Help! Is there some kind of magic rot thing I should be multipying by to take any angle of placement into account? particularly in the crucial part of "PRIM_POSITION, (BasePos + OpenVector)" in the doorOpen() function?
Many thanks, Chaz.
____________________________
BasePos = llGetPos(); //defined at default state entry
//constants
vector SIZE_CLOSED = <2.958, 0.050, 3.29>;
vector SIZE_OPENED = <.5, 0.050, 3.29>;
float DoorMoveDistance = 1.2;
//adjust direction for x / y axis
if (DoorDirection == "-1"

DoorDir = -1;
else DoorDir = 1;
DoorDirLR = DoorMoveDistance * DoorDir;
if (DoorAxis == ""
{DoorAxis = "x";
}
if (DoorAxis == "x"
{OpenVector = <DoorDirLR, 0, 0>;
}
else if (DoorAxis == "y"
{OpenVector = <0, DoorDirLR, 0>;
}
//the actual functions
doorClose() {
llSetPrimitiveParams([PRIM_SIZE, SIZE_CLOSED,
PRIM_POSITION, BasePos]);
}
doorOpen() {
llSetPrimitiveParams(
[ PRIM_SIZE, SIZE_OPENED,
PRIM_POSITION, (BasePos + OpenVector)]);
}