maketransform VEX function

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

Contexts: image3d, chop, cop, pop, sop, surface, displace, fog, light, shadow, photon, cvex

  1. matrix3 maketransform(vector zaxis, vector yaxis)

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

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

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

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)). The specifications for the trs and xyz parameters can be found in $HFS/houdini/vex/include/math.h

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 function, this function expects rotations in degrees, not radians.