Matrix3D 结构

定义

表示用于三维空间转换的 4 x 4 矩阵。Represents a 4 x 4 matrix used for transformations in 3-D space.

public value class 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

请注意,由于第四列也是可访问的,因此矩阵允许开发人员表示仿射转换和非仿射转换。Note that because the fourth column is also accessible, the matrix allows developers to represent affine as well as non-affine transforms.

矩阵可以追加到其他矩阵或附加到其他矩阵之前。Matrices can be appended or prepended to other matrices. 将矩阵附加到矩阵 B 表示按 B 然后按的方式进行转换:Appending matrix A to matrix B denotes a transformation by B and then by A:

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

此 @no__t 的第一行、第一列中的值为-0。The value in the first row and first column of this Matrix3D. 有关更多信息,请参见 M11 属性。For more information, see the M11 property.

M12M12
System.Double

此 @no__t 的第一行和第二列中的值。The value in the first row and second column of this Matrix3D. 有关更多信息,请参见 M12 属性。For more information, see the M12 property.

M13M13
System.Double

此 @no__t 的第一行、第三列中的值为-0。The value in the first row and third column of this Matrix3D. 有关更多信息,请参见 M13 属性。For more information, see the M13 property.

M14M14
System.Double

此 @no__t 中第一行、第四列的值为-0。The value in the first row and fourth column of this Matrix3D. 有关更多信息,请参见 M14 属性。For more information, see the M14 property.

M21M21
System.Double

此 @no__t 的第二行、第一列中的值。The value in the second row and first column of this Matrix3D. 有关更多信息,请参见 M21 属性。For more information, see the M21 property.

M22M22
System.Double

此 @no__t 的第二行、第二列中的值-0。The value in the second row and second column of this Matrix3D. 有关更多信息,请参见 M22 属性。For more information, see the M22 property.

M23M23
System.Double

此 @no__t 的第二行、第三列中的值-0。The value in the second row and third column of this Matrix3D. 有关更多信息,请参见 M23 属性。For more information, see the M23 property.

M24M24
System.Double

此 @no__t 的第二行、第四列中的值-0。The value in the second row and fourth column of this Matrix3D. 有关更多信息,请参见 M24 属性。For more information, see the M24 property.

M31M31
System.Double

此 @no__t 的第三行、第一列中的值为-0。The value in the third row and first column of this Matrix3D. 有关更多信息,请参见 M31 属性。For more information, see the M31 property.

M32M32
System.Double

此 @no__t 的第三行和第二列中的值-0。The value in the third row and second column of this Matrix3D. 有关更多信息,请参见 M32 属性。For more information, see the M32 property.

M33M33
System.Double

此 @no__t 的第三行、第三列中的值-0。The value in the third row and third column of this Matrix3D. 有关更多信息,请参见 M34 属性。For more information, see the M34 property.

M34M34
System.Double

此 @no__t 中第三行、第四列的值-0。The value in the third row and fourth column of this Matrix3D. 有关更多信息,请参见 M33 属性。For more information, see the M33 property.

M44M44
System.Double

此 @no__t 中第四行、第四列的值。The value in the fourth row and fourth column of this Matrix3D. 有关更多信息,请参见 M44 属性。For more information, see the M44 property.

offsetXoffsetX
System.Double

此 @no__t 的第四行、第一列中的值。The value in the fourth row and first column of this Matrix3D. 有关更多信息,请参见 OffsetX 属性。For more information, see the OffsetX property.

offsetYoffsetY
System.Double

此 @no__t 中第四行、第二列的值。The value in the fourth row and second column of this Matrix3D. 有关更多信息,请参见 OffsetY 属性。For more information, see the OffsetY property.

offsetZoffsetZ
System.Double

此 @no__t 中第四行、第三列的值。The value in the fourth row and third column of this Matrix3D. 有关更多信息,请参见 OffsetZ 属性。For more information, see the OffsetZ property.

构造函数

Matrix3D(Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double)

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

属性

Determinant

检索此 Matrix3D 结构的行列式。Retrieves the determinant of this Matrix3D structure.

HasInverse

获取指示是否可反转此 Matrix3D 的值。Gets a value that indicates whether this Matrix3D is invertible.

Identity

Matrix3D 结构更改为单位 Matrix3DChanges a Matrix3D structure into an identity Matrix3D.

IsAffine

获取指示此 Matrix3D 结构是否为仿射结构的值。Gets a value that indicates whether this Matrix3D structure is affine.

IsIdentity

确定此 Matrix3D 结构是否为单位 Matrix3D。Determines whether this Matrix3D structure is an identity Matrix3D.

M11

获取或设置此 Matrix3D 结构中第一行与第一列相交处的值。Gets or sets the value of the first row and first column of this Matrix3D structure.

M12

获取或设置此 Matrix3D 结构中第一行与第二列相交处的值。Gets or sets the value of the first row and second column of this Matrix3D structure.

M13

获取或设置此 Matrix3D 结构中第一行、第三列的值。Gets or sets the value of the first row and third column of this Matrix3D structure.

M14

获取或设置此 Matrix3D 结构中第一行、第四列的值。Gets or sets the value of the first row and fourth column of this Matrix3D structure.

M21

获取或设置此 Matrix3D 结构中第二行与第一列相交处的值。Gets or sets the value of the second row and first column of this Matrix3D structure.

M22

获取或设置此 Matrix3D 结构中第二行与第二列相交处的值。Gets or sets the value of the second row and second column of this Matrix3D structure.

M23

获取或设置此 Matrix3D 结构中第二行、第三列的值。Gets or sets the value of the second row and third column of this Matrix3D structure.

M24

获取或设置此 Matrix3D 结构中第二行、第四列的值。Gets or sets the value of the second row and fourth column of this Matrix3D structure.

M31

获取或设置此 Matrix3D 结构中第三行与第一列相交处的值。Gets or sets the value of the third row and first column of this Matrix3D structure.

M32

获取或设置此 Matrix3D 结构中第三行与第二列相交处的值。Gets or sets the value of the third row and second column of this Matrix3D structure.

M33

获取或设置此 Matrix3D 结构中第三行、第三列的值。Gets or sets the value of the third row and third column of this Matrix3D structure.

M34

获取或设置此 Matrix3D 结构中第三行、第四列的值。Gets or sets the value of the third row and fourth column of this Matrix3D structure.

M44

获取或设置此 Matrix3D 结构中第四行、第四列的值。Gets or sets the value of the fourth row and fourth column of this Matrix3D structure.

OffsetX

获取或设置此 Matrix3D 结构中第四行、第一列的值。Gets or sets the value of the fourth row and first column of this Matrix3D structure.

OffsetY

获取或设置此 Matrix3D 结构中第四行、第二列的值。Gets or sets the value of the fourth row and second column of this Matrix3D structure.

OffsetZ

获取或设置此 Matrix3D 结构中第四行、第三列的值。Gets or sets the value of the fourth row and third column of this Matrix3D structure.

方法

Append(Matrix3D)

在当前矩阵后面追加一个指定矩阵。Appends a specified matrix to the current matrix.

Equals(Matrix3D)

测试两个矩阵是否相等。Tests equality between two matrices.

Equals(Matrix3D, Matrix3D)

测试两个矩阵是否相等。Tests equality between two matrices.

Equals(Object)

测试两个矩阵是否相等。Tests equality between two matrices.

GetHashCode()

返回此矩阵的哈希代码。Returns the hash code for this matrix.

Invert()

反转此 Matrix3D 结构。Inverts this Matrix3D structure.

Multiply(Matrix3D, Matrix3D)

将指定的矩阵相乘。Multiplies the specified matrices.

Parse(String)

Matrix3D 结构的字符串表示形式转换为等效的 Matrix3D 结构。Converts a string representation of a Matrix3D structure into the equivalent Matrix3D structure.

Prepend(Matrix3D)

在当前矩阵前面添加一个指定矩阵。Prepends a specified matrix to the current matrix.

Rotate(Quaternion)

在当前 Matrix3D 后面追加旋转转换。Appends a rotation transform to the current Matrix3D.

RotateAt(Quaternion, Point3D)

围绕指定的 Matrix3D 旋转此 Point3DRotates this Matrix3D about the specified Point3D.

RotateAtPrepend(Quaternion, Point3D)

在此 Point3D 结构前面添加围绕指定中心 Matrix3D 的旋转。Prepends a rotation about a specified center Point3D to this Matrix3D structure.

RotatePrepend(Quaternion)

在此 Quaternion 结构前面添加 Matrix3D 指定的旋转。Prepends a rotation specified by a Quaternion to this Matrix3D structure.

Scale(Vector3D)

在此 Vector3D 结构后面追加指定的缩放 Matrix3DAppends the specified scale Vector3D to this Matrix3D structure.

ScaleAt(Vector3D, Point3D)

围绕指定的 Matrix3D 按指定的 Vector3D 对此 Point3D 结构进行缩放。Scales this Matrix3D structure by the specified Vector3D about the specified Point3D.

ScaleAtPrepend(Vector3D, Point3D)

在此 Point3D 结构前面添加围绕指定 Matrix3D 的指定缩放转换。Prepends the specified scale transformation about the specified Point3D to this Matrix3D structure.

ScalePrepend(Vector3D)

在当前 Matrix3D 结构前面添加指定的缩放 Vector3DPrepends the specified scale Vector3D to the current Matrix3D structure.

SetIdentity()

将此 Matrix3D 结构更改为恒等矩阵。Changes this Matrix3D structure into an identity matrix.

ToString()

创建此 Matrix3D 结构的字符串表示形式。Creates a string representation of this Matrix3D structure.

ToString(IFormatProvider)

创建此 Matrix3D 结构的字符串表示形式。Creates a string representation of this Matrix3D structure.

Transform(Point3D)

Point3D 转换指定的 Matrix3D 并返回结果。Transforms the specified Point3D by the Matrix3D and returns the result.

Transform(Point3D[])

Point3D 转换数组中指定的 Matrix3D 对象。Transforms the specified Point3D objects in the array by the Matrix3D.

Transform(Point4D)

Point4D 转换指定的 Matrix3D 并返回结果。Transforms the specified Point4D by the Matrix3D and returns the result.

Transform(Point4D[])

Point4D 转换数组中指定的 Matrix3D 对象并返回结果。Transforms the specified Point4D objects in the array by the Matrix3D and returns the result.

Transform(Vector3D)

用此 Vector3D 转换指定的 Matrix3DTransforms the specified Vector3D by this Matrix3D.

Transform(Vector3D[])

用此 Vector3D 转换数组中指定的 Matrix3D 对象。Transforms the specified Vector3D objects in the array by this Matrix3D.

Translate(Vector3D)

在当前 Matrix3D 结构后面追加指定偏移量的平移。Appends a translation of the specified offset to the current Matrix3D structure.

TranslatePrepend(Vector3D)

在此 Matrix3D 结构前面添加指定偏移量的平移。Prepends a translation of the specified offset to this Matrix3D structure.

操作员

Equality(Matrix3D, Matrix3D)

比较两个 Matrix3D 实例是否完全相等。Compares two Matrix3D instances for exact equality.

Inequality(Matrix3D, Matrix3D)

比较两个 Matrix3D 实例是否完全不相等。Compares two Matrix3D instances for exact inequality.

Multiply(Matrix3D, Matrix3D)

将指定的矩阵相乘。Multiplies the specified matrices.

显式界面实现

IFormattable.ToString(String, IFormatProvider)

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

适用于

另请参阅