Matrix.Identity Property

Returns an instance of the identity matrix.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

public static Matrix Identity { get; }

Property Value

The identity matrix.

Except for the main diagonal, whose elements are all ones, the identity matrix is a square matrix composed of zeros. Unlike all other matrix multiplications, the multiplication between an identity matrix and another matrix is commutative.

This is useful for initializing a matrix to a known value before you perform additional operations, such as a transformation.

Multiplying a matrix with its inverse results in an identity matrix.

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7

Community Additions