# Matrix3D 结构

## 定义

``public value class Matrix3D : IFormattable``
``````[System.ComponentModel.TypeConverter(typeof(System.Windows.Media.Media3D.Matrix3DConverter))]
public struct Matrix3D : IFormattable``````
``````[System.ComponentModel.TypeConverter(typeof(System.Windows.Media.Media3D.Matrix3DConverter))]
[System.Serializable]
public struct Matrix3D : IFormattable``````
``````type Matrix3D = struct
interface IFormattable``````
``````Public Structure Matrix3D
Implements IFormattable``````

Matrix3D

## 示例

``````// Multiplies a Vector3D by a Matrix3D using the static Multiply method.
// Returns a Vector3D.

Vector3D vector1 = new Vector3D(20, 30, 40);
Matrix3D matrix1 = new Matrix3D(10, 10, 10, 0, 20, 20, 20, 0, 30, 30, 30, 0, 5, 10, 15, 1);
Vector3D vectorResult = new Vector3D();

vectorResult = Vector3D.Multiply(vector1,matrix1);
// vector Result is equal to (2000, 2000, 2000)
``````
``````' Multiplies a Vector3D by a Matrix3D using the static Multiply method.
' Returns a Vector3D.

Dim vector1 As New Vector3D(20, 30, 40)
Dim matrix1 As New Matrix3D(10, 10, 10, 0, 20, 20, 20, 0, 30, 30, 30, 0, 5, 10, 15, 1)
Dim vectorResult As New Vector3D()

vectorResult = Vector3D.Multiply(vector1,matrix1)
' vector Result is equal to (2000, 2000, 2000)
``````

## 注解

Matrix3D 具有以下行向量语法：Matrix3D has the following row-vector syntax:

M11 M12 M13 M14
M21 M22 M23 M24
M31 M32 M33 M34
OffsetX OffsetY OffsetZ M44

### XAML 特性用法XAML Attribute Usage

``````<object property="m11, m12, m13, m21, m22, m23, m31, m32, m33, offsetX, offsetY, offsetZ"/>
- or -
<object property="Identity"/>
``````

### XAML 值XAML Values

M11M11
System.Double

Matrix3D的第一行、第一列中的值。The value in the first row and first column of this Matrix3D. 有关详细信息，请参阅 M11 属性。For more information, see the M11 property.

M12M12
System.Double

Matrix3D的第一行和第二列中的值。The value in the first row and second column of this Matrix3D. 有关详细信息，请参阅 M12 属性。For more information, see the M12 property.

M13M13
System.Double

Matrix3D的第一行、第三列中的值。The value in the first row and third column of this Matrix3D. 有关详细信息，请参阅 M13 属性。For more information, see the M13 property.

M14M14
System.Double

Matrix3D的第一行、第四列中的值。The value in the first row and fourth column of this Matrix3D. 有关详细信息，请参阅 M14 属性。For more information, see the M14 property.

M21M21
System.Double

Matrix3D的第二行、第一列中的值。The value in the second row and first column of this Matrix3D. 有关详细信息，请参阅 M21 属性。For more information, see the M21 property.

M22M22
System.Double

Matrix3D的第二行、第二列中的值。The value in the second row and second column of this Matrix3D. 有关详细信息，请参阅 M22 属性。For more information, see the M22 property.

M23M23
System.Double

Matrix3D的第二行、第三列中的值。The value in the second row and third column of this Matrix3D. 有关详细信息，请参阅 M23 属性。For more information, see the M23 property.

M24M24
System.Double

Matrix3D中第二行、第四列的值。The value in the second row and fourth column of this Matrix3D. 有关详细信息，请参阅 M24 属性。For more information, see the M24 property.

M31M31
System.Double

Matrix3D的第三行、第一列中的值。The value in the third row and first column of this Matrix3D. 有关详细信息，请参阅 M31 属性。For more information, see the M31 property.

M32-16msM32
System.Double

Matrix3D的第三行和第二列中的值。The value in the third row and second column of this Matrix3D. 有关详细信息，请参阅 M32 属性。For more information, see the M32 property.

M33M33
System.Double

Matrix3D的第三行、第三列中的值。The value in the third row and third column of this Matrix3D. 有关详细信息，请参阅 M34 属性。For more information, see the M34 property.

M34M34
System.Double

Matrix3D中第三行、第四列的值。The value in the third row and fourth column of this Matrix3D. 有关详细信息，请参阅 M33 属性。For more information, see the M33 property.

M44M44
System.Double

Matrix3D中第四行、第四列的值。The value in the fourth row and fourth column of this Matrix3D. 有关详细信息，请参阅 M44 属性。For more information, see the M44 property.

offsetXoffsetX
System.Double

Matrix3D的第四行、第一列中的值。The value in the fourth row and first column of this Matrix3D. 有关详细信息，请参阅 OffsetX 属性。For more information, see the OffsetX property.

offsetYoffsetY
System.Double

Matrix3D的第四行、第二列中的值。The value in the fourth row and second column of this Matrix3D. 有关详细信息，请参阅 OffsetY 属性。For more information, see the OffsetY property.

offsetZoffsetZ
System.Double

Matrix3D的第四行、第三列中的值。The value in the fourth row and third column of this Matrix3D. 有关详细信息，请参阅 OffsetZ 属性。For more information, see the OffsetZ property.

## 构造函数

 设置矩阵的初始值的构造函数。Constructor that sets matrix's initial values.

## 属性

 检索此 Matrix3D 结构的行列式。Retrieves the determinant of this Matrix3D structure. 获取指示是否可反转此 Matrix3D 的值。Gets a value that indicates whether this Matrix3D is invertible. 将 Matrix3D 结构更改为单位 Matrix3D。Changes a Matrix3D structure into an identity Matrix3D. 获取指示此 Matrix3D 结构是否为仿射结构的值。Gets a value that indicates whether this Matrix3D structure is affine. 确定此 Matrix3D 结构是否为单位 Matrix3D。Determines whether this Matrix3D structure is an identity Matrix3D. 获取或设置此 Matrix3D 结构中第一行与第一列相交处的值。Gets or sets the value of the first row and first column of this Matrix3D structure. 获取或设置此 Matrix3D 结构中第一行与第二列相交处的值。Gets or sets the value of the first row and second column of this Matrix3D structure. 获取或设置此 Matrix3D 结构中第一行、第三列的值。Gets or sets the value of the first row and third column of this Matrix3D structure. 获取或设置此 Matrix3D 结构中第一行、第四列的值。Gets or sets the value of the first row and fourth column of this Matrix3D structure. 获取或设置此 Matrix3D 结构中第二行与第一列相交处的值。Gets or sets the value of the second row and first column of this Matrix3D structure. 获取或设置此 Matrix3D 结构中第二行与第二列相交处的值。Gets or sets the value of the second row and second column of this Matrix3D structure. 获取或设置此 Matrix3D 结构中第二行、第三列的值。Gets or sets the value of the second row and third column of this Matrix3D structure. 获取或设置此 Matrix3D 结构中第二行、第四列的值。Gets or sets the value of the second row and fourth column of this Matrix3D structure. 获取或设置此 Matrix3D 结构中第三行与第一列相交处的值。Gets or sets the value of the third row and first column of this Matrix3D structure. 获取或设置此 Matrix3D 结构中第三行与第二列相交处的值。Gets or sets the value of the third row and second column of this Matrix3D structure. 获取或设置此 Matrix3D 结构中第三行、第三列的值。Gets or sets the value of the third row and third column of this Matrix3D structure. 获取或设置此 Matrix3D 结构中第三行、第四列的值。Gets or sets the value of the third row and fourth column of this Matrix3D structure. 获取或设置此 Matrix3D 结构中第四行、第四列的值。Gets or sets the value of the fourth row and fourth column of this Matrix3D structure. 获取或设置此 Matrix3D 结构中第四行、第一列的值。Gets or sets the value of the fourth row and first column of this Matrix3D structure. 获取或设置此 Matrix3D 结构中第四行、第二列的值。Gets or sets the value of the fourth row and second column of this Matrix3D structure. 获取或设置此 Matrix3D 结构中第四行、第三列的值。Gets or sets the value of the fourth row and third column of this Matrix3D structure.

## 方法

 在当前矩阵后面追加一个指定矩阵。Appends a specified matrix to the current matrix. 测试两个矩阵是否相等。Tests equality between two matrices. 测试两个矩阵是否相等。Tests equality between two matrices. 测试两个矩阵是否相等。Tests equality between two matrices. 返回此矩阵的哈希代码。Returns the hash code for this matrix. 反转此 Matrix3D 结构。Inverts this Matrix3D structure. 将指定的矩阵相乘。Multiplies the specified matrices. 将 Matrix3D 结构的字符串表示形式转换为等效的 Matrix3D 结构。Converts a string representation of a Matrix3D structure into the equivalent Matrix3D structure. 在当前矩阵前面添加一个指定矩阵。Prepends a specified matrix to the current matrix. 在当前 Matrix3D 后面追加旋转转换。Appends a rotation transform to the current Matrix3D. 围绕指定的 Matrix3D 旋转此 Point3D。Rotates this Matrix3D about the specified Point3D. 在此 Point3D 结构前面添加围绕指定中心 Matrix3D 的旋转。Prepends a rotation about a specified center Point3D to this Matrix3D structure. 在此 Quaternion 结构前面添加 Matrix3D 指定的旋转。Prepends a rotation specified by a Quaternion to this Matrix3D structure. 在此 Vector3D 结构后面追加指定的缩放 Matrix3D。Appends the specified scale Vector3D to this Matrix3D structure. 围绕指定的 Matrix3D 按指定的 Vector3D 对此 Point3D 结构进行缩放。Scales this Matrix3D structure by the specified Vector3D about the specified Point3D. 在此 Point3D 结构前面添加围绕指定 Matrix3D 的指定缩放转换。Prepends the specified scale transformation about the specified Point3D to this Matrix3D structure. 在当前 Matrix3D 结构前面添加指定的缩放 Vector3D。Prepends the specified scale Vector3D to the current Matrix3D structure. 将此 Matrix3D 结构更改为恒等矩阵。Changes this Matrix3D structure into an identity matrix. 创建此 Matrix3D 结构的字符串表示形式。Creates a string representation of this Matrix3D structure. 创建此 Matrix3D 结构的字符串表示形式。Creates a string representation of this Matrix3D structure. 用 Point3D 转换指定的 Matrix3D 并返回结果。Transforms the specified Point3D by the Matrix3D and returns the result. 用 Point3D 转换数组中指定的 Matrix3D 对象。Transforms the specified Point3D objects in the array by the Matrix3D. 用 Point4D 转换指定的 Matrix3D 并返回结果。Transforms the specified Point4D by the Matrix3D and returns the result. 用 Point4D 转换数组中指定的 Matrix3D 对象并返回结果。Transforms the specified Point4D objects in the array by the Matrix3D and returns the result. 用此 Vector3D 转换指定的 Matrix3D。Transforms the specified Vector3D by this Matrix3D. 用此 Vector3D 转换数组中指定的 Matrix3D 对象。Transforms the specified Vector3D objects in the array by this Matrix3D. 在当前 Matrix3D 结构后面追加指定偏移量的平移。Appends a translation of the specified offset to the current Matrix3D structure. 在此 Matrix3D 结构前面添加指定偏移量的平移。Prepends a translation of the specified offset to this Matrix3D structure.

## 运算符

 比较两个 Matrix3D 实例是否完全相等。Compares two Matrix3D instances for exact equality. 比较两个 Matrix3D 实例是否完全不相等。Compares two Matrix3D instances for exact inequality. 将指定的矩阵相乘。Multiplies the specified matrices.

## 显式接口实现

 使用指定格式对当前实例的值设置格式。Formats the value of the current instance using the specified format.