Changed the representation of rotations for 3D matrix.