36 lines
822 B
Markdown
36 lines
822 B
Markdown
# Matrix4x4::Orthographic
|
|
|
|
```cpp
|
|
static Matrix4x4 Orthographic(float left, float right, float bottom, float top, float near, float far)
|
|
```
|
|
|
|
创建正交投影矩阵。用于 2D UI 或建筑制图等需要保持物体实际大小的场景。
|
|
|
|
**参数:**
|
|
- `left` - 左裁切面 x 坐标
|
|
- `right` - 右裁切面 x 坐标
|
|
- `bottom` - 下裁切面 y 坐标
|
|
- `top` - 上裁切面 y 坐标
|
|
- `near` - 近裁切面 z 坐标
|
|
- `far` - 远裁切面 z 坐标
|
|
|
|
**返回:** 正交投影矩阵
|
|
|
|
**线程安全:** ✅
|
|
|
|
**复杂度:** O(1)
|
|
|
|
**示例:**
|
|
|
|
```cpp
|
|
#include "XCEngine/Math/Matrix4.h"
|
|
|
|
using namespace XCEngine::Math;
|
|
|
|
Matrix4 ortho = Matrix4::Orthographic(-10.0f, 10.0f, -5.0f, 5.0f, 0.1f, 100.0f);
|
|
```
|
|
|
|
## 相关文档
|
|
|
|
- [Matrix4](matrix4.md) - 返回类总览
|
|
- [Perspective](perspective.md) - 透视投影 |