Пример #1
0
        public static void Multiply(ref Matrix4x3 left, ref Matrix4x3 right, out Matrix4x3 result)
        {
            result = new Matrix4x3(
                left.M00 * right.M00 + left.M10 * right.M01 + left.M20 * right.M02,
                left.M01 * right.M00 + left.M11 * right.M01 + left.M21 * right.M02,
                left.M02 * right.M00 + left.M12 * right.M01 + left.M22 * right.M02,

                left.M00 * right.M10 + left.M10 * right.M11 + left.M20 * right.M12,
                left.M01 * right.M10 + left.M11 * right.M11 + left.M21 * right.M12,
                left.M02 * right.M10 + left.M12 * right.M11 + left.M22 * right.M12,

                left.M00 * right.M20 + left.M10 * right.M21 + left.M20 * right.M22,
                left.M01 * right.M20 + left.M11 * right.M21 + left.M21 * right.M22,
                left.M02 * right.M20 + left.M12 * right.M21 + left.M22 * right.M22,

                left.M00 * right.M30 + left.M10 * right.M31 + left.M20 * right.M32 + left.M30,
                left.M01 * right.M30 + left.M11 * right.M31 + left.M21 * right.M32 + left.M31,
                left.M02 * right.M30 + left.M12 * right.M31 + left.M22 * right.M32 + left.M32
            );
        }
Пример #2
0
 public static Vector3 Multiply(ref Matrix4x3 m, Vector3 v)
 {
     return new Vector3(
         m.M00 * v.X + m.M10 * v.Y + m.M20 * v.Z + m.M30,
         m.M01 * v.X + m.M11 * v.Y + m.M21 * v.Z + m.M31,
         m.M02 * v.X + m.M12 * v.Y + m.M22 * v.Z + m.M32
     );
 }