m3_affine function

3D Affine