Matrix3D 結構

定義

表示 4 x 4 矩陣,用於 3-D 空間中的轉換。

public value class Matrix3D : IFormattable
[System.ComponentModel.TypeConverter(typeof(System.Windows.Media.Media3D.Matrix3DConverter))]
[System.Serializable]
public struct 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>]
type Matrix3D = struct
    interface IFormattable
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Media.Media3D.Matrix3DConverter))>]
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 具有下列資料列向量語法:

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

請注意,因為第四個數據行也是可存取的,所以矩陣可讓開發人員代表相依性和非相依轉換。

矩陣可以附加或前面附加至其他矩陣。 將矩陣 A 附加至矩陣 B 代表 B 的轉換,然後由 A:

XAML Attribute Usage

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

XAML 值

M11
System.Double

這個 中第一列和第一欄的值 Matrix3D 。 如需詳細資訊,請參閱 M11 屬性 (Property)。

M12
System.Double

這個 的第一個資料列和第二個數據行 Matrix3D 中的值。 如需詳細資訊,請參閱 M12 屬性 (Property)。

M13
System.Double

這個 Matrix3D 的第一個資料列和第三個數據行中的值。 如需詳細資訊,請參閱 M13 屬性 (Property)。

M14
System.Double

這個 的第一個資料列和第四個數據行 Matrix3D 中的值。 如需詳細資訊,請參閱 M14 屬性 (Property)。

M21
System.Double

這個 的第二個數據列和第一個資料行 Matrix3D 中的值。 如需詳細資訊,請參閱 M21 屬性 (Property)。

M22
System.Double

這個 的第二列和第二欄 Matrix3D 的值。 如需詳細資訊,請參閱 M22 屬性 (Property)。

M23
System.Double

這個 的第二列和第三個數據行中的 Matrix3D 值。 如需詳細資訊,請參閱 M23 屬性 (Property)。

M24
System.Double

這個 的第二列和第四個數據行 Matrix3D 中的值。 如需詳細資訊,請參閱 M24 屬性 (Property)。

M31
System.Double

這個 的第三列和第一個資料行中的 Matrix3D 值。 如需詳細資訊,請參閱 M31 屬性 (Property)。

M32
System.Double

這個 的第三列和第二個數據行中的 Matrix3D 值。 如需詳細資訊,請參閱 M32 屬性 (Property)。

M33
System.Double

這個 中第三列和第三欄的值 Matrix3D 。 如需詳細資訊,請參閱 M34 屬性 (Property)。

M34
System.Double

這個 的第三個數據列和第四個數據行 Matrix3D 中的值。 如需詳細資訊,請參閱 M33 屬性 (Property)。

M44
System.Double

這個 的第四列和第四個數據行中的 Matrix3D 值。 如需詳細資訊,請參閱 M44 屬性 (Property)。

offsetX
System.Double

這個 的第四列和第一個資料行中的 Matrix3D 值。 如需詳細資訊,請參閱 OffsetX 屬性 (Property)。

offsetY
System.Double

這個 的第四列和第二個數據行中的 Matrix3D 值。 如需詳細資訊,請參閱 OffsetY 屬性 (Property)。

offsetZ
System.Double

這個 的第四列和第三個數據行 Matrix3D 中的值。 如需詳細資訊,請參閱 OffsetZ 屬性 (Property)。

建構函式

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

用於設定矩陣初始值的建構函式。

屬性

Determinant

擷取這個 Matrix3D 結構的行列式。

HasInverse

取得值,這個值表示這個 Matrix3D 是否可以反轉。

Identity

Matrix3D 結構變更為單位 Matrix3D

IsAffine

取得值,這個值表示這個 Matrix3D 結構是否為仿射。

IsIdentity

判斷這個 Matrix3D 結構是否為單位 Matrix3D。

M11

取得或設定這個 Matrix3D 之結構第一列第一行的值。

M12

取得或設定這個 Matrix3D 結構之第一列第二行的值。

M13

取得或設定這個 Matrix3D 結構之第一列第三欄的值。

M14

取得或設定這個 Matrix3D 結構之第一列第四欄的值。

M21

取得或設定這個 Matrix3D 結構之第二列第一行的值。

M22

取得或設定這個 Matrix3D 結構之第二列第二行的值。

M23

取得或設定這個 Matrix3D 結構之第二列第三欄的值。

M24

取得或設定這個 Matrix3D 結構之第二列第四欄的值。

M31

取得或設定這個 Matrix3D 結構之第三列第一行的值。

M32

取得或設定這個 Matrix3D 結構之第三列第二行的值。

M33

取得或設定這個 Matrix3D 結構之第三列第三欄的值。

M34

取得或設定這個 Matrix3D 結構之第三列第四欄的值。

M44

取得或設定這個 Matrix3D 結構之第四列第四欄的值。

OffsetX

取得或設定這個 Matrix3D 結構之第四列第一欄的值。

OffsetY

取得或設定這個 Matrix3D 結構之第四列第二欄的值。

OffsetZ

取得或設定這個 Matrix3D 結構之第四列第三欄的值。

方法

Append(Matrix3D)

在目前的矩陣之後加上指定的矩陣。

Equals(Matrix3D)

測試兩個矩陣之間是否相等。

Equals(Matrix3D, Matrix3D)

測試兩個矩陣之間是否相等。

Equals(Object)

測試兩個矩陣之間是否相等。

GetHashCode()

傳回這個矩陣的雜湊碼。

Invert()

反轉這個 Matrix3D 結構。

Multiply(Matrix3D, Matrix3D)

將指定的矩陣相乘。

Parse(String)

Matrix3D 結構的字串表示轉換為對等的 Matrix3D 結構。

Prepend(Matrix3D)

在目前矩陣之前加上指定的矩陣。

Rotate(Quaternion)

在目前的 Matrix3D 之後加上旋轉轉換。

RotateAt(Quaternion, Point3D)

繞著指定的 Matrix3D 旋轉 Point3D

RotateAtPrepend(Quaternion, Point3D)

在這個 Point3D 結構之前,加上繞著指定的中心 Matrix3D 的旋轉。

RotatePrepend(Quaternion)

在這個 Quaternion 結構之前加上 Matrix3D 所指定的旋轉。

Scale(Vector3D)

在這個 Vector3D 結構之前加上指定的縮放 Matrix3D

ScaleAt(Vector3D, Point3D)

繞著指定的 Matrix3D,依指定的 Vector3D 縮放這個 Point3D 結構。

ScaleAtPrepend(Vector3D, Point3D)

在這個 Point3D 結構之前,加上繞著指定的 Matrix3D 的縮放。

ScalePrepend(Vector3D)

在目前的 Matrix3D 結構之前加上指定的縮放 Vector3D

SetIdentity()

將這個 Matrix3D 結構變更為單位矩陣。

ToString()

建立這個 Matrix3D 結構字串表示。

ToString(IFormatProvider)

建立這個 Matrix3D 結構字串表示。

Transform(Point3D)

Point3D 轉換指定的 Matrix3D 並傳回結果。

Transform(Point3D[])

Point3D 轉換陣列中的所指定 Matrix3D

Transform(Point4D)

Point4D 轉換指定的 Matrix3D 並傳回結果。

Transform(Point4D[])

Point4D 轉換陣列中的所指定 Matrix3D 並傳回結果。

Transform(Vector3D)

依這個 Vector3D 轉換指定的 Matrix3D

Transform(Vector3D[])

依這個 Vector3D 轉換陣列中的所指定 Matrix3D

Translate(Vector3D)

在目前的 Matrix3D 結構之後加上所指定位移的平移。

TranslatePrepend(Vector3D)

在這個 Matrix3D 結構之前加上所指定位移的平移。

運算子

Equality(Matrix3D, Matrix3D)

比較兩個 Matrix3D 執行個體是否完全相等。

Inequality(Matrix3D, Matrix3D)

比較兩個 Matrix3D 執行個體是否完全不相等。

Multiply(Matrix3D, Matrix3D)

將指定的矩陣相乘。

明確介面實作

IFormattable.ToString(String, IFormatProvider)

使用指定的格式,格式化目前執行個體的值。

適用於

另請參閱