You've asked for rotation functions. I've copied only those at first. Afterwards I decided to just include entire file, but forgot to replace [code] contents. Fixing now, sorry.
Unfortunately, I've not worked with 3dGS for a while now, but it was fun