Mat4:target
EditSets a model transform matrix that moves to from
and orients model towards to
point.
This is used when rendered model should always point towards a point of interest. The resulting Mat4 object can be used as model pose.
The target() function produces same result as lookAt() after matrix inversion.
self = Mat4:target(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. |