Skip to content

maketransform

matrix3  maketransform(vector zaxis, vector yaxis)

matrix3  maketransform(int xyz, vector angles)

matrix  maketransform(vector zaxis, vector yaxis, vector translate)

matrix  maketransform(int trs, int xyz, vector t, vector r)

matrix  maketransform(int trs, int xyz, vector t, vector r, vector s)

matrix  maketransform(int trs, int xyz, vector t, vector r, vector s, vector p)

matrix  maketransform(int trs, int xyz, vector t, vector r, vector s, vector p, vector pr)

matrix  maketransform(int trs, int xyz, vector t, vector r, vector s, vector p, vector pr, vector shears)

Builds a 3×3 or 4×4 transform matrix.

maketransform(int trs, ...) builds a general 4×4 transform matrix given an order of transformations (trs), an order for rotations (xyz), a vector representing the translation (t), rotation (r), scale (s) (and optionally a pivot (p), pivot rotation (pr), and shears (shears)).

maketransform(int xyz, vector angles) builds a 3×3 rotation matrix using the same rules as maketransform(int trs, ...) but only using the rotation parameters.

maketransform(vector zaxis, yaxis, ...) builds either a 3×3 transform matrix or a 4×4 transform matrix. The matrix will be constructed so that the z-axis will be transformed to the z-axis specified with the given up vector (yaxis). Thus, maketransform({0,0,1}, {0,1,0}) will result in an identity matrix. The version which returns a 4×4 transform will apply the translation to the 4×4 matrix. This function is very similar to the lookat function. The vectors passed in are not normalized meaning that scales should be preserved in construction of the transform.

Note Unlike most VEX functions, this function expects rotations in degrees, not radians.

trs

One of the transform order constants listed below, which can be imported from $HFS/houdini/vex/include/math.h.

Constant nameTransform Order
XFORM_SRTScale, Rotate, Translate
XFORM_STRScale, Translate, Rotate
XFORM_RSTRotate, Scale, Translate
XFORM_RTSRotate, Translate, Scale
XFORM_TSRTranslate, Scale, Rotate
XFORM_TRSTranslate, Rotate, Scale

xyz

One of the rotation order constants listed below, which can be imported from $HFS/houdini/vex/include/math.h.

Constant nameRotation Order
XFORM_XYZRotate order X, Y, Z
XFORM_XZYRotate order X, Z, Y
XFORM_YXZRotate order Y, X, Z
XFORM_YZXRotate order Y, Z, X
XFORM_ZXYRotate order Z, X, Y
XFORM_ZYXRotate order Z, Y, X