Click or drag to resize

Matrix Structure

Defines a 4x4 matrix.

A default constructed one is Zero.

You are unlikely to ever directly construct one, you'd use one of the static methods returning a Matrix, e.g. RotationAxis(Vector3, Double)

Inheritance Hierarchy
SystemObject
  SystemValueType
    Microsoft.DirectXMatrix

Namespace: Microsoft.DirectX
Assembly: Demo3D.Common (in Demo3D.Common.dll) Version: 19.00.00
Syntax
C#
[SerializableAttribute]
public struct Matrix : IEquatable<Matrix>

The Matrix type exposes the following members.

Constructors
 NameDescription
Public methodMatrix Initializes a new instance of the Matrix struct.
Top
Properties
 NameDescription
Public propertyInverted Invert this Matrix
Public propertyOrigin The Origin of the Matrix
Public propertyOriginX The X component of Origin as a Single
Public propertyOriginXD The X component of Origin as a Double
Public propertyOriginY The Y component of Origin as a Single
Public propertyOriginYD The Y component of Origin as a Double
Public propertyOriginZ The Z component of Origin as a Single
Public propertyOriginZD The Z component of Origin as a Double
Public propertyTransposed Transpose this Matrix
Public propertyXAxis The X-Axis of the Matrix
Public propertyYAxis The Y-Axis of the Matrix
Public propertyZAxis The Z-Axis of the Matrix
Top
Methods
 NameDescription
Public methodStatic memberAddMatrix addition
Public methodEquals(Matrix)Matrix exact equality - see EQ(Matrix, Matrix) for alternative
Public methodEquals(Object)Matrix exact equality - see EQ(Matrix, Matrix) for alternative
(Overrides ValueTypeEquals(Object))
Public methodGetHashCode Returns the hash code for the current Matrix.
(Overrides ValueTypeGetHashCode)
Public methodInvert Invert this Matrix
Public methodStatic memberInvert(Matrix) Invert given Matrix
Public methodMultiply(Matrix)Matrix multiplication
Public methodStatic memberMultiply(Matrix, Matrix)Matrix multiplication
Public methodStatic memberRotationAxis(Vector3, Double) Form a rotation Matrix rotating about given axis
Public methodStatic memberRotationAxis(Vector3, Double, Vector3) Form a rotation Matrix rotating about given axis, offset from the origin
Public methodStatic memberRotationAxisDegrees(Vector3, Double) Form a rotation Matrix rotating about given axis
Public methodStatic memberRotationAxisDegrees(Vector3, Double, Vector3) Form a rotation Matrix rotating about given axis, offset from the origin
Public methodStatic memberRotationQuaternion Form a rotation Matrix from Quaternion
Public methodStatic memberRotationX(Double) Form a rotation Matrix rotating about the X-Axis
Public methodStatic memberRotationX(Double, Vector3) Form a rotation Matrix rotating about the X-Axis, offset from the origin
Public methodStatic memberRotationXDegrees(Double) Form a rotation Matrix rotating about the X-Axis
Public methodStatic memberRotationXDegrees(Double, Vector3) Form a rotation Matrix rotating about the X-Axis, offset from the origin
Public methodStatic memberRotationY(Double) Form a rotation Matrix rotating about the Y-Axis
Public methodStatic memberRotationY(Double, Vector3) Form a rotation Matrix rotating about the Y-Axis, offset from the origin
Public methodStatic memberRotationYawPitchRoll(Vector3) Form a rotation Matrix from Yaw (Y-Axis rotation), Pitch (X-Axis rotation) and Roll (Z-Axis rotation) contained within the Vector3 with Yaw being the Y component, Pitch being the X component and Roll being the the Z component.
Public methodStatic memberRotationYawPitchRoll(Vector3, Vector3) Form a rotation Matrix from Yaw (Y-Axis rotation), Pitch (X-Axis rotation) and Roll (Z-Axis rotation) contained within the Vector3 with Yaw being the Y component, Pitch being the X component and Roll being the the Z component, offset from the origin.
Public methodStatic memberRotationYawPitchRoll(Double, Double, Double) Form a rotation Matrix from Yaw (Y-Axis rotation), Pitch (X-Axis rotation) and Roll (Z-Axis rotation)
Public methodStatic memberRotationYawPitchRoll(Double, Double, Double, Vector3) Form a rotation Matrix from Yaw (Y-Axis rotation), Pitch (X-Axis rotation) and Roll (Z-Axis rotation), offset from the origin
Public methodStatic memberRotationYawPitchRollDegrees(Vector3) Form a rotation Matrix from Yaw (Y-Axis rotation), Pitch (X-Axis rotation) and Roll (Z-Axis rotation) contained within the Vector3 with Yaw being the Y component, Pitch being the X component and Roll being the the Z component.
Public methodStatic memberRotationYawPitchRollDegrees(Vector3, Vector3) Form a rotation Matrix from Yaw (Y-Axis rotation), Pitch (X-Axis rotation) and Roll (Z-Axis rotation) contained within the Vector3 with Yaw being the Y component, Pitch being the X component and Roll being the the Z component, offset from the origin.
Public methodStatic memberRotationYawPitchRollDegrees(Double, Double, Double) Form a rotation Matrix from Yaw (Y-Axis rotation), Pitch (X-Axis rotation) and Roll (Z-Axis rotation)
Public methodStatic memberRotationYawPitchRollDegrees(Double, Double, Double, Vector3) Form a rotation Matrix from Yaw (Y-Axis rotation), Pitch (X-Axis rotation) and Roll (Z-Axis rotation), offset from the origin
Public methodStatic memberRotationYDegrees(Double) Form a rotation Matrix rotating about the Y-Axis
Public methodStatic memberRotationYDegrees(Double, Vector3) Form a rotation Matrix rotating about the Y-Axis, offset from the origin
Public methodStatic memberRotationZ(Double) Form a rotation Matrix rotating about the Z-Axis
Public methodStatic memberRotationZ(Double, Vector3) Form a rotation Matrix rotating about the Z-Axis, offset from the origin
Public methodStatic memberRotationZDegrees(Double) Form a rotation Matrix rotating about the Z-Axis
Public methodStatic memberRotationZDegrees(Double, Vector3) Form a rotation Matrix rotating about the Z-Axis, offset from the origin
Public methodStatic memberScaling(Double) Form a scaling Matrix
Public methodStatic memberScaling(Vector3) Form a scaling Matrix
Public methodStatic memberScaling(Double, Double, Double) Form a scaling Matrix
Public methodStatic memberSubtractMatrix subtraction
Public methodToString Returns a string that represents the current Matrix.
(Overrides ValueTypeToString)
Public methodTransform(Plane) Transform Plane by this Matrix
Public methodTransform(Vector2) Transforms a Vector2 by this Matrix
Public methodTransform(Vector3) Transforms a Vector3 by this Matrix
Public methodTransform(Vector4) Transforms a Vector4 by this Matrix
Public methodTransformCoordinate(Vector2) Transform Vector2 coordinate by this Matrix
Public methodTransformCoordinate(Vector3) Transform Vector3 coordinate by this Matrix
Public methodTransformNormal(Vector2) Transform Vector2 normal by this Matrix
Public methodTransformNormal(Vector3) Transform Vector3 normal by this Matrix
Public methodStatic memberTranslation(Vector3) Form a translation Matrix
Public methodStatic memberTranslation(Double, Double, Double) Form a translation Matrix
Public methodTranspose Transpose this Matrix
Public methodStatic memberTranspose(Matrix) Transpose given Matrix
Top
Operators
 NameDescription
Public operatorStatic memberAddition(Matrix, Matrix)Matrix addition
Public operatorStatic memberEquality(Matrix, Matrix)Matrix exact equality - see EQ(Matrix, Matrix) for alternative
Public operatorStatic memberInequality(Matrix, Matrix)Matrix exact inequality - see EQ(Matrix, Matrix) for alternative
Public operatorStatic memberMultiply(Matrix, Matrix)Matrix multiplication
Public operatorStatic memberSubtraction(Matrix, Matrix)Matrix subtraction
Top
Fields
 NameDescription
Public fieldStatic memberIdentity A Matrix representing the "Identity" matrix
Public fieldStatic memberRotationX0 Equivalent to Identity
Public fieldStatic memberRotationX180 Precomputed rotation Matrix of 180 degrees (or -180 degrees) about the X-Axis
Public fieldStatic memberRotationX270 Precomputed rotation Matrix of 270 degrees (or -90 degrees) about the X-Axis
Public fieldStatic memberRotationX360 Equivalent to Identity
Public fieldStatic memberRotationX90 Precomputed rotation Matrix of 90 degrees (or -270 degrees) about the X-Axis
Public fieldStatic memberRotationY0 Equivalent to Identity
Public fieldStatic memberRotationY180 Precomputed rotation Matrix of 180 degrees (or -180 degrees) about the Y-Axis
Public fieldStatic memberRotationY270 Precomputed rotation Matrix of 270 degrees (or -90 degrees) about the Y-Axis
Public fieldStatic memberRotationY360 Equivalent to Identity
Public fieldStatic memberRotationY90 Precomputed rotation Matrix of 90 degrees (or -270 degrees) about the Y-Axis
Public fieldStatic memberRotationZ0 Equivalent to Identity
Public fieldStatic memberRotationZ180 Precomputed rotation Matrix of 180 degrees (or -180 degrees) about the Y-Axis
Public fieldStatic memberRotationZ270 Precomputed rotation Matrix of 270 degrees (or -90 degrees) about the Z-Axis
Public fieldStatic memberRotationZ360 Equivalent to Identity
Public fieldStatic memberRotationZ90 Precomputed rotation Matrix of 90 degrees (or -270 degrees) about the Z-Axis
Public fieldStatic memberZero A Matrix with all of its components set to zero.
Top
See Also