Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Matrix Structure

Matrix Structure

Defines a matrix.

Namespace:  Microsoft.Xna.Framework
Assembly:  Microsoft.Xna.Framework.Math (in Microsoft.Xna.Framework.Math.dll)

public struct Matrix

The Matrix type exposes the following members.

  NameDescription
Public methodMatrixInitializes a new instance of Matrix.
Top

  NameDescription
Public propertyBackwardGets and sets the backward vector of the Matrix.
Public propertyDownGets and sets the down vector of the Matrix.
Public propertyForwardGets and sets the forward vector of the Matrix.
Public propertyStatic memberIdentityReturns an instance of the identity matrix.
Public propertyLeftGets and sets the left vector of the Matrix.
Public propertyRightGets and sets the right vector of the Matrix.
Public propertyTranslationGets and sets the translation vector of the Matrix.
Public propertyUpGets and sets the up vector of the Matrix.
Top

  NameDescription
Public methodStatic memberAdd(Matrix, Matrix)Adds a matrix to another matrix.
Public methodStatic memberAdd(Matrix, Matrix, Matrix)Adds a matrix to another matrix.
Public methodStatic memberCreateBillboard(Vector3, Vector3, Vector3, Nullable<Vector3>)Creates a spherical billboard that rotates around a specified object position.
Public methodStatic memberCreateBillboard(Vector3, Vector3, Vector3, Nullable<Vector3>, Matrix)Creates a spherical billboard that rotates around a specified object position.
Public methodStatic memberCreateConstrainedBillboard(Vector3, Vector3, Vector3, Nullable<Vector3>, Nullable<Vector3>)Creates a cylindrical billboard that rotates around a specified axis.
Public methodStatic memberCreateConstrainedBillboard(Vector3, Vector3, Vector3, Nullable<Vector3>, Nullable<Vector3>, Matrix)Creates a cylindrical billboard that rotates around a specified axis.
Public methodStatic memberCreateFromAxisAngle(Vector3, Single)Creates a new Matrix that rotates around an arbitrary vector.
Public methodStatic memberCreateFromAxisAngle(Vector3, Single, Matrix)Creates a new Matrix that rotates around an arbitrary vector.
Public methodStatic memberCreateFromQuaternion(Quaternion)Creates a rotation Matrix from a Quaternion.
Public methodStatic memberCreateFromQuaternion(Quaternion, Matrix)Creates a rotation Matrix from a Quaternion.
Public methodStatic memberCreateFromYawPitchRoll(Single, Single, Single)Creates a new rotation matrix from a specified yaw, pitch, and roll.
Public methodStatic memberCreateFromYawPitchRoll(Single, Single, Single, Matrix)Fills in a rotation matrix from a specified yaw, pitch, and roll.
Public methodStatic memberCreateLookAt(Vector3, Vector3, Vector3)Creates a view matrix.
Public methodStatic memberCreateLookAt(Vector3, Vector3, Vector3, Matrix)Creates a view matrix.
Public methodStatic memberCreateOrthographic(Single, Single, Single, Single)Builds an orthogonal projection matrix.
Public methodStatic memberCreateOrthographic(Single, Single, Single, Single, Matrix)Builds an orthogonal projection matrix.
Public methodStatic memberCreateOrthographicOffCenter(Single, Single, Single, Single, Single, Single)Builds a customized, orthogonal projection matrix.
Public methodStatic memberCreateOrthographicOffCenter(Single, Single, Single, Single, Single, Single, Matrix)Builds a customized, orthogonal projection matrix.
Public methodStatic memberCreatePerspective(Single, Single, Single, Single)Builds a perspective projection matrix and returns the result by value.
Public methodStatic memberCreatePerspective(Single, Single, Single, Single, Matrix)Builds a perspective projection matrix and returns the result by reference.
Public methodStatic memberCreatePerspectiveFieldOfView(Single, Single, Single, Single)Builds a perspective projection matrix based on a field of view and returns by value.
Public methodStatic memberCreatePerspectiveFieldOfView(Single, Single, Single, Single, Matrix)Builds a perspective projection matrix based on a field of view and returns by reference.
Public methodStatic memberCreatePerspectiveOffCenter(Single, Single, Single, Single, Single, Single)Builds a customized, perspective projection matrix.
Public methodStatic memberCreatePerspectiveOffCenter(Single, Single, Single, Single, Single, Single, Matrix)Builds a customized, perspective projection matrix.
Public methodStatic memberCreateReflection(Plane)Creates a Matrix that reflects the coordinate system about a specified Plane.
Public methodStatic memberCreateReflection(Plane, Matrix)Fills in an existing Matrix so that it reflects the coordinate system about a specified Plane.
Public methodStatic memberCreateRotationX(Single)Returns a matrix that can be used to rotate a set of vertices around the x-axis.
Public methodStatic memberCreateRotationX(Single, Matrix)Populates data into a user-specified matrix that can be used to rotate a set of vertices around the x-axis.
Public methodStatic memberCreateRotationY(Single)Returns a matrix that can be used to rotate a set of vertices around the y-axis.
Public methodStatic memberCreateRotationY(Single, Matrix)Populates data into a user-specified matrix that can be used to rotate a set of vertices around the y-axis.
Public methodStatic memberCreateRotationZ(Single)Returns a matrix that can be used to rotate a set of vertices around the z-axis.
Public methodStatic memberCreateRotationZ(Single, Matrix)Populates data into a user-specified matrix that can be used to rotate a set of vertices around the z-axis.
Public methodStatic memberCreateScale(Single)Creates a scaling Matrix.
Public methodStatic memberCreateScale(Vector3)Creates a scaling Matrix.
Public methodStatic memberCreateScale(Single, Matrix)Creates a scaling Matrix.
Public methodStatic memberCreateScale(Vector3, Matrix)Creates a scaling Matrix.
Public methodStatic memberCreateScale(Single, Single, Single)Creates a scaling Matrix.
Public methodStatic memberCreateScale(Single, Single, Single, Matrix)Creates a scaling Matrix.
Public methodStatic memberCreateShadow(Vector3, Plane)Creates a Matrix that flattens geometry into a specified Plane as if casting a shadow from a specified light source.
Public methodStatic memberCreateShadow(Vector3, Plane, Matrix)Fills in a Matrix to flatten geometry into a specified Plane as if casting a shadow from a specified light source.
Public methodStatic memberCreateTranslation(Vector3)Creates a translation Matrix.
Public methodStatic memberCreateTranslation(Vector3, Matrix)Creates a translation Matrix.
Public methodStatic memberCreateTranslation(Single, Single, Single)Creates a translation Matrix.
Public methodStatic memberCreateTranslation(Single, Single, Single, Matrix)Creates a translation Matrix.
Public methodStatic memberCreateWorld(Vector3, Vector3, Vector3)Creates a world matrix with the specified parameters.
Public methodStatic memberCreateWorld(Vector3, Vector3, Vector3, Matrix)Creates a world matrix with the specified parameters.
Public methodDecomposeExtracts the scalar, translation, and rotation components from a 3D scale/rotate/translate (SRT) Matrix.
Public methodDeterminantCalculates the determinant of the matrix.
Public methodStatic memberDivide(Matrix, Matrix)Divides the components of a matrix by the corresponding components of another matrix.
Public methodStatic memberDivide(Matrix, Single)Divides the components of a matrix by a scalar.
Public methodStatic memberDivide(Matrix, Matrix, Matrix)Divides the components of a matrix by the corresponding components of another matrix.
Public methodStatic memberDivide(Matrix, Single, Matrix)Divides the components of a matrix by a scalar.
Public methodEquals(Object)Returns a value that indicates whether the current instance is equal to a specified object. (Overrides ValueType.Equals(Object).)
Public methodEquals(Matrix)Determines whether the specified Object is equal to the Matrix.
Public methodGetHashCodeGets the hash code of this object. (Overrides ValueType.GetHashCode().)
Public methodStatic memberInvert(Matrix)Calculates the inverse of a matrix.
Public methodStatic memberInvert(Matrix, Matrix)Calculates the inverse of a matrix.
Public methodStatic memberLerp(Matrix, Matrix, Single)Linearly interpolates between the corresponding values of two matrices.
Public methodStatic memberLerp(Matrix, Matrix, Single, Matrix)Linearly interpolates between the corresponding values of two matrices.
Public methodStatic memberMultiply(Matrix, Matrix)Multiplies a matrix by another matrix.
Public methodStatic memberMultiply(Matrix, Single)Multiplies a matrix by a scalar value.
Public methodStatic memberMultiply(Matrix, Matrix, Matrix)Multiplies a matrix by another matrix.
Public methodStatic memberMultiply(Matrix, Single, Matrix)Multiplies a matrix by a scalar value.
Public methodStatic memberNegate(Matrix)Negates individual elements of a matrix.
Public methodStatic memberNegate(Matrix, Matrix)Negates individual elements of a matrix.
Public methodStatic memberSubtract(Matrix, Matrix)Subtracts matrices.
Public methodStatic memberSubtract(Matrix, Matrix, Matrix)Subtracts matrices.
Public methodToStringRetrieves a string representation of the current object. (Overrides ValueType.ToString().)
Public methodStatic memberTransform(Matrix, Quaternion)Transforms a Matrix by applying a Quaternion rotation.
Public methodStatic memberTransform(Matrix, Quaternion, Matrix)Transforms a Matrix by applying a Quaternion rotation.
Public methodStatic memberTranspose(Matrix)Transposes the rows and columns of a matrix.
Public methodStatic memberTranspose(Matrix, Matrix)Transposes the rows and columns of a matrix.
Top

  NameDescription
Public operatorStatic memberAdditionAdds a matrix to another matrix.
Public operatorStatic memberDivision(Matrix, Matrix)Divides the components of a matrix by the corresponding components of another matrix.
Public operatorStatic memberDivision(Matrix, Single)Divides the components of a matrix by a scalar.
Public operatorStatic memberEqualityCompares a matrix for equality with another matrix.
Public operatorStatic memberInequalityTests a matrix for inequality with another matrix.
Public operatorStatic memberMultiply(Single, Matrix)Multiplies a matrix by a scalar value.
Public operatorStatic memberMultiply(Matrix, Matrix)Multiplies a matrix by another matrix.
Public operatorStatic memberMultiply(Matrix, Single)Multiplies a matrix by a scalar value.
Public operatorStatic memberSubtractionSubtracts matrices.
Public operatorStatic memberUnaryNegationNegates individual elements of a matrix.
Top

  NameDescription
Public fieldM11Value at row 1 column 1 of the matrix.
Public fieldM12Value at row 1 column 2 of the matrix.
Public fieldM13Value at row 1 column 3 of the matrix.
Public fieldM14Value at row 1 column 4 of the matrix.
Public fieldM21Value at row 2 column 1 of the matrix.
Public fieldM22Value at row 2 column 2 of the matrix.
Public fieldM23Value at row 2 column 3 of the matrix.
Public fieldM24Value at row 2 column 4 of the matrix.
Public fieldM31Value at row 3 column 1 of the matrix.
Public fieldM32Value at row 3 column 2 of the matrix.
Public fieldM33Value at row 3 column 3 of the matrix.
Public fieldM34Value at row 3 column 4 of the matrix.
Public fieldM41Value at row 4 column 1 of the matrix.
Public fieldM42Value at row 4 column 2 of the matrix.
Public fieldM43Value at row 4 column 3 of the matrix.
Public fieldM44Value at row 4 column 4 of the matrix.
Top

Matrices use a row vector layout in the XNA Framework. Matrices can be either row vector or column vector. Row vector matrices view vectors as a row from left to right, while column vector matrices view vectors as a column from top to bottom. For example, the x, y, and z of a matrix's translation vector in the XNA Framework would correspond to the fields M41, M42, M43.

Silverlight

Supported in: 5

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2015 Microsoft