You should add this:http://forum.blockland.us/index.php?topic=216752
http://en.wikipedia.org/wiki/Transit_Kings
function rotatevector(vector, angleaxis){ %x = getword(%vector,0); %y = getword(%vector,1); %z = getword(%vector,2); %u["x"] = getword(%angleaxis,0); %u["y"] = getword(%angleaxis,1); %u["z"] = getword(%angleaxis,2); %angl = getword(%angleaxis,3) * -1; %cos = mcos(%angl); %sin = msin(%angl); %a[1,1] = %cos + (%u["x"] * %u["x"] * (1 - %cos)); %a[1,2] = (%u["x"] * %u["y"] * (1 - %cos)) - (%u["z"] * %sin); %a[1,3] = (%u["x"] * %u["z"] * (1 - %cos)) + (%u["y"] * %sin); %a[2,1] = (%u["y"] * %u["x"] * (1 - %cos)) + (%u["z"] * %sin); %a[2,2] = %cos + (%u["y"] * %u["y"] * (1 - %cos)); %a[2,3] = (%u["y"] * %u["z"] * (1 - %cos)) - (%u["x"] * %sin); %a[3,1] = (%u["z"] * %u["x"] * (1 - %cos)) - (%u["y"] * %sin); %a[3,2] = (%u["z"] * %u["y"] * (1 - %cos)) + (%u["x"] * %sin); %a[3,3] = %cos + (%u["z"] * %u["z"] * (1 - %cos)); %newx = (%a[1,1] * %x) + (%a[1,2] * %y) + (%a[1,3] * %z); %newy = (%a[2,1] * %x) + (%a[2,2] * %y) + (%a[2,3] * %z); %newz = (%a[3,1] * %x) + (%a[3,2] * %y) + (%a[3,3] * %z); return %newx SPC %newy SPC %newz;}
http://forum.blockland.us/index.php?topic=226269
In smart message make %type the actual command instead of that if statement, it allows for more flexibility.