共用方式為


Matrix4x4.CreateViewport 方法

定義

從指定的參數建立右手檢視區矩陣。

public:
 static System::Numerics::Matrix4x4 CreateViewport(float x, float y, float width, float height, float minDepth, float maxDepth);
public static System.Numerics.Matrix4x4 CreateViewport (float x, float y, float width, float height, float minDepth, float maxDepth);
static member CreateViewport : single * single * single * single * single * single -> System.Numerics.Matrix4x4
Public Shared Function CreateViewport (x As Single, y As Single, width As Single, height As Single, minDepth As Single, maxDepth As Single) As Matrix4x4

參數

x
Single

檢視區左上角的 X 座標。

y
Single

檢視區左上角的 Y 座標。

width
Single

檢視區寬度。

height
Single

檢視區高度。

minDepth
Single

檢視區最小深度。

maxDepth
Single

檢視區最大深度。

傳回

右手檢視區矩陣。

備註

檢視區矩陣 |width / 2 |0 |0 |0 | |0 |-height / 2 |0 |0 | |0 |0 |minDepth - maxDepth |0 | |x + 寬度 / 2 |y + 高度 / 2 |minDepth |1 |

適用於