Matrix4x4.CreateViewportLeftHanded Method

Definition

Creates a left-handed viewport matrix from the specified parameters.

C#
public static System.Numerics.Matrix4x4 CreateViewportLeftHanded(float x, float y, float width, float height, float minDepth, float maxDepth);

Parameters

x
Single

X coordinate of the viewport upper left corner.

y
Single

Y coordinate of the viewport upper left corner.

width
Single

Viewport width.

height
Single

Viewport height.

minDepth
Single

Viewport minimum depth.

maxDepth
Single

Viewport maximum depth.

Returns

The left-handed viewport matrix.

Remarks

Viewport matrix

| width / 2 | 0 | 0 | 0 | | 0 | -height / 2 | 0 | 0 | | 0 | 0 | maxDepth - minDepth | 0 | | x + width / 2 | y + height / 2 | minDepth | 1 |

Applies to

Product Versions
.NET 8, 9, 10