Matrix3D 結構

定義

表示 4 x 4 矩陣,用於 3-D 空間中的轉換。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. 將矩陣 A 附加至矩陣 B 表示由 B 和 then 轉換,再加上:Appending matrix A to matrix B denotes a transformation by B and then by A:

XAML Attribute UsageXAML 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 屬性 (Property)。For more information, see the M11 property.

M12M12
System.Double

這個 Matrix3D 的第一個資料列和第二個數據行中的值。The value in the first row and second column of this Matrix3D. 如需詳細資訊,請參閱 M12 屬性 (Property)。For more information, see the M12 property.

M13M13
System.Double

這個 Matrix3D 的第一個資料列和第三個數據行中的值。The value in the first row and third column of this Matrix3D. 如需詳細資訊,請參閱 M13 屬性 (Property)。For more information, see the M13 property.

M14M14
System.Double

這個 Matrix3D 的第一個資料列和第四個數據行中的值。The value in the first row and fourth column of this Matrix3D. 如需詳細資訊,請參閱 M14 屬性 (Property)。For more information, see the M14 property.

M21M21
System.Double

這個 Matrix3D 的第二列和第一個資料行中的值。The value in the second row and first column of this Matrix3D. 如需詳細資訊,請參閱 M21 屬性 (Property)。For more information, see the M21 property.

M22M22
System.Double

這個 Matrix3D 的第二列和第二個數據行中的值。The value in the second row and second column of this Matrix3D. 如需詳細資訊,請參閱 M22 屬性 (Property)。For more information, see the M22 property.

M23M23
System.Double

這個 Matrix3D 的第二列和第三個數據行中的值。The value in the second row and third column of this Matrix3D. 如需詳細資訊,請參閱 M23 屬性 (Property)。For more information, see the M23 property.

M24M24
System.Double

這個 Matrix3D 的第二列和第四個數據行中的值。The value in the second row and fourth column of this Matrix3D. 如需詳細資訊,請參閱 M24 屬性 (Property)。For more information, see the M24 property.

M31M31
System.Double

這個 Matrix3D 的第三列和第一個資料行中的值。The value in the third row and first column of this Matrix3D. 如需詳細資訊,請參閱 M31 屬性 (Property)。For more information, see the M31 property.

M32M32
System.Double

這個 Matrix3D 的第三列和第二個數據行中的值。The value in the third row and second column of this Matrix3D. 如需詳細資訊,請參閱 M32 屬性 (Property)。For more information, see the M32 property.

M33M33
System.Double

這個 Matrix3D 的第三列和第三個數據行中的值。The value in the third row and third column of this Matrix3D. 如需詳細資訊,請參閱 M34 屬性 (Property)。For more information, see the M34 property.

M34M34
System.Double

這個 Matrix3D 的第三列和第四個數據行中的值。The value in the third row and fourth column of this Matrix3D. 如需詳細資訊,請參閱 M33 屬性 (Property)。For more information, see the M33 property.

M44M44
System.Double

此 @no__t 的第四個數據列和第四個數據行中的值-0。The value in the fourth row and fourth column of this Matrix3D. 如需詳細資訊,請參閱 M44 屬性 (Property)。For more information, see the M44 property.

offsetXoffsetX
System.Double

第四個數據列中的值和此 @no__t 的第一個資料行-0。The value in the fourth row and first column of this Matrix3D. 如需詳細資訊,請參閱 OffsetX 屬性 (Property)。For more information, see the OffsetX property.

offsetYoffsetY
System.Double

這個 @no__t 的第四個數據列和第二個數據行中的值-0。The value in the fourth row and second column of this Matrix3D. 如需詳細資訊,請參閱 OffsetY 屬性 (Property)。For more information, see the OffsetY property.

offsetZoffsetZ
System.Double

此 @no__t 的第四個數據列和第三個數據行中的值-0。The value in the fourth row and third column of this Matrix3D. 如需詳細資訊,請參閱 OffsetZ 屬性 (Property)。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 轉換陣列中的所指定 Matrix3DTransforms 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 轉換陣列中的所指定 Matrix3DTransforms 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.

適用於

另請參閱