Прочетете на английски Редактиране

Споделяне чрез


Matrix4x4.CreateTranslation Method

Definition

Creates a translation matrix.

Overloads

CreateTranslation(Single, Single, Single)

Creates a translation matrix from the specified X, Y, and Z components.

CreateTranslation(Vector3)

Creates a translation matrix from the specified 3-dimensional vector.

CreateTranslation(Single, Single, Single)

Source:
Matrix4x4.cs
Source:
Matrix4x4.cs
Source:
Matrix4x4.cs

Creates a translation matrix from the specified X, Y, and Z components.

C#
public static System.Numerics.Matrix4x4 CreateTranslation(float xPosition, float yPosition, float zPosition);

Parameters

xPosition
Single

The amount to translate on the X axis.

yPosition
Single

The amount to translate on the Y axis.

zPosition
Single

The amount to translate on the Z axis.

Returns

The translation matrix.

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1
UWP 10.0

CreateTranslation(Vector3)

Source:
Matrix4x4.cs
Source:
Matrix4x4.cs
Source:
Matrix4x4.cs

Creates a translation matrix from the specified 3-dimensional vector.

C#
public static System.Numerics.Matrix4x4 CreateTranslation(System.Numerics.Vector3 position);

Parameters

position
Vector3

The amount to translate in each axis.

Returns

The translation matrix.

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1
UWP 10.0