Files
XCSDD/docs/api/math/matrix4/lookat.md

23 lines
415 B
Markdown
Raw Normal View History

# Matrix4::LookAt
```cpp
static Matrix4 LookAt(const Vector3& eye, const Vector3& target, const Vector3& up)
```
创建视图矩阵(观察矩阵)。
**参数:**
- `eye` - 相机位置
- `target` - 观察目标点
- `up` - 世界空间中的上方向
**返回:** `Matrix4` - 视图矩阵
**复杂度:** O(1)
**示例:**
```cpp
Matrix4 view = Matrix4::LookAt(cameraPos, target, Vector3::Up());
```