Mat4:lookAt

Sets a transform matrix that positions a viewer so that it looks at a target point.

m = Mat4:lookAt(from, to, up)

Arguments

NameTypeDefaultDescription
fromVec3The position of the viewer.
toVec3The position of the target.
upVec3Vec3(0, 1, 0)The up vector of the viewer.

Returns

NameTypeDescription
mMat4The original matrix.

See also