update rotate3D function