Mat4:lookAt
EditSets a view transform matrix that moves and orients camera to look at a target point.
This is useful for changing camera position and orientation. The resulting Mat4 matrix can be passed to lovr.graphics.transform()
directly (without inverting) before rendering the scene.
The lookAt() function produces same result as target() after matrix inversion.
self = Mat4:lookAt(from, to, up)
Arguments
Name | Type | Default | Description |
from | Vec3 | The position of the viewer. | |
to | Vec3 | The position of the target. | |
up | Vec3 | Vec3(0, 1, 0) | The up vector of the viewer. |
Returns
Name | Type | Description |
self | Mat4 | The modified matrix. |
See also
Mat4:target
Quat:direction
Mat4