I know it's only a small performance boost, but 3d rotation is used in so many presets that I think it's worthwhile. There may be more ways to optimize this method, but I'm too happy about my neat new method to care right now.
per Frame:
sx=-sin(xa);
cxcz=cos(xa)*cos(za);
cxsz=cos(xa)*sin(za);
cxcy=cos(xa)*cos(ya);
cxsy=cos(xa)*sin(ya);
sysxczmcysz=sin(ya)*sin(xa)*cos(za)-cos(ya)*sin(za);
sysxszpcycz=sin(ya)*sin(xa)*sin(za)+cos(ya)*cos(za);
cysxczpsysz=cos(ya)*sin(xa)*cos(za)+sin(xa)*sin(za);
cysxszmsycz=cos(ya)*sin(xa)*sin(za)-sin(ya)*cos(za);
Per Point:
x1=what you want x coord to be;
y1=what you want y coord to be;
z1=what you want z coord to be;
x3=x1*cxcz+y1*cxsz+z1*sx;
y3=x1*sysxczmcysz+y1*sysxszpcycz+z1*cxsy;
z3=x1*cysxczpsysz+y1*cysxszmsycz+z1*cxcy;
xa is the angle that x is rotated by
ya is the angle that y is rotated by
za is the angle that z is rotated by
new method of doing 3d rotation
As far as I know this hasn't been discovered before. I found a new way to do 3d rotation that runs a little faster than the usual method. I attatched two SSCs, one that uses old method and one that uses new method, and both are the same otherwise i think. n=10000. The new one runs 5 fps faster on my comp than the old one. This should work for DMs as well. This is how it works: