Accord.Math.Matrix4x4.CreateTranslation C# (CSharp) Method

CreateTranslation() public static method

Creates translation matrix for the specified movement amount.

The specified vector is copied to the 3rd column of the result matrix. All diagonal elements are set to 1. The rest of matrix is initialized with zeros.

public static CreateTranslation ( Vector3 position ) : Matrix4x4
position Vector3 Vector which set direction and amount of movement.
return Matrix4x4
        public static Matrix4x4 CreateTranslation(Vector3 position)
        {
            Matrix4x4 m = Matrix4x4.Identity;

            m.V03 = position.X;
            m.V13 = position.Y;
            m.V23 = position.Z;

            return m;
        }