add mat4.look_at(...)

This commit is contained in:
MihailRis
2024-07-11 03:31:48 +03:00
parent 4c8ae465c7
commit dc926ce4df
3 changed files with 35 additions and 0 deletions
+9
View File
@@ -115,6 +115,15 @@ mat4.decompose(m: matrix)
}
```
## Look at point - *mat4.look_at(...)*
```lua
-- creates a view matrix from the 'eye' point to the 'center' point with up vector specified
mat4.look_at(eye: vec3, center: vec3, up: vec3)
-- writes the view matrix to dst
mat4.look_at(eye: vec3, center: vec3, up: vec3, dst: matrix)
```
## Casting to string - *mat4.tostring(...)*
```lua
+9
View File
@@ -115,6 +115,15 @@ mat4.decompose(m: matrix)
}
```
## Отслеживание точки *mat4.look_at(...)*
```lua
-- cоздает матрицу вида с точки 'eye' на точку 'center', где вектор 'up' определяет верх.
mat4.look_at(eye: vec3, center: vec3, up: vec3)
-- записывает матрицу вида в dst
mat4.look_at(eye: vec3, center: vec3, up: vec3, dst: matrix)
```
## Перевод в строку - *mat4.tostring(...)*
```lua