mlookatup expression function

Computes the transformation matrix of a lookat from one vector to another, with an up vector.

All Usage Examples

See also: mlookat

Usage

mlookatup(v1, v2, upv)

Computes a transform matrix specifying a lookat from vector v1 to the vector v2, taking up vector upv into consideration.

The vectors are converted to 3 vectors for this computation. The resulting matrix will be a 3×3 matrix.

Examples

explodematrix(mlookatup(vtorigin("","/obj/from"),vtorigin("","/obj/to"),vtorigin("","/obj/up")),"SRT","XYZ","RX")

Computes the lookat matrix and returns the rotation value for RX.