gfx.math.transform

Affine transforms module

Members

Functions

affineMult
auto affineMult(ML ml, MR mr)

Affine matrix multiplication.

rotate
M rotate(M m, T angle)
M rotate(M m, T angle, V axis)
M rotate(M m, T angle, T x, T y, T z)

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
Mat3x3!T rotation(T angle)
auto rotation(T angle, V axis)
auto rotation(T angle, T x, T y, T z)

Build a rotation matrix. angle in radians.

rotationPure
auto rotationPure(T angle, V axis)

Build a pure 3d rotation matrix with angle in radians

scale
Mat3!(CommonType!(X, Y)) scale(X x, Y y)
auto scale(V v)
Mat4!(CommonType!(X, Y, Z)) scale(X x, Y y, Z z)

Build a scale matrix.

scale
M scale(M m, X x, Y y)
M scale(M m, V v)
M scale(M m, X x, Y y, Z z)

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
auto transform(V v, M m)

Transform a vector by a matrix in homogenous coordinates.

translate
M translate(M m, X x, Y y)
M translate(M m, V v)
M translate(M m, X x, Y y, Z z)

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
auto translation(X x, Y y)
auto translation(V v)
auto translation(X x, Y y, Z z)

Build a translation matrix.

Meta