mlookat expression function

Computes the transformation matrix of a lookat from one vector to another.

All Usage Examples

See also: mlookatup

Usage

mlookat(v1, v2)

Computes a transform matrix specifying a lookat from vector v1 to the vector v2.

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

Examples

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

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