Module gfx.math.transform

Affine transforms module

Functions

NameDescription
affineMult(ml, mr) Affine matrix multiplication.
affineRotation(angle)
affineScale(x, y) Build a scale matrix.
affineTranslation(x, y) Build a translation matrix.
eulerAngles(a, b, c) Build a rotation matrix from Euler angles The convention taken is Xa, Zb, Xc
eulerAngles(angles)
rotate(m, angle) Append a rotation transform inferred from arguments to the matrix m. This is equivalent to the expression
rotation(...) * m
but actually save computation by knowing where the ones and zeros are in a pure rotation matrix.
rotation(angle) Build a rotation matrix. angle in radians.
rotation(angle, axis)
rotation(angle, x, y, z)
rotationPure(angle, axis) Build a pure 3d rotation matrix with angle in radians
scale(x, y) Build a scale matrix.
scale(m, x, y) Append a scale transform inferred from arguments to the matrix m. This is equivalent to the expression
scale(...) * m
but actually save computation by knowing where the ones and zeros are in a pure scale matrix.
transform(v, m) Transform a vector by a matrix in homogenous coordinates.
translate(m, x, y) Append a translation transform inferred from arguments to the matrix m. This is equivalent to the expression
translation(...) * m
but actually save computation by knowing where the ones and zeros are in a pure translation matrix.
translation(x, y) Build a translation matrix.