explodematrixp expression function
Explodes a 3×3 or 4×4 matrix into the euler rotations required to rebuild it.
Usage
explodematrixp(mat, p, trs, xyz, component)
The returned components can be stuffed directly into Houdini rotation, scale, and translate channels.
This expression is exactly like explodematrix, except it requires you to specify a pivot position vector. This is useful if you know the pivot position of the matrix being processed.
mat is the matrix to transform. trs and xyz give the order of the expansion. In trs, a “t” represents translation, “r” rotation, and “s” scale. The xyz refers to the order of the rotations. The component is a string describing which channel to extract. It is “[trs][xyz]” (e.g. "tx" or "ry"), where the t, r, or s chooses the channel (translate, rotate, or scale), and the x, y, or z chooses the axis.
Examples
explodematrixp(optransform("/obj/geo1"), vector3(ch("/obj/geo1/px"), ch("/obj/geo1/py"), ch("/obj/geo1/pz")), "RST", "XYZ", "RZ")