Skip to content

cf_m4_from_trs

Category: math
GitHub: cute_math3d.h


Composes translation, rotation, and scale into a transform matrix.

CF_M4x4 cf_m4_from_trs(CF_V3 translation, CF_Quat rotation, CF_V3 scale)
Parameters Description
translation The translation.
rotation The rotation. Should be unit length.
scale The per-axis scale.

Return Value

Returns the matrix cf_m4_translate(t) * cf_quat_to_m4(r) * cf_m4_scale(s).

Remarks

The inverse of cf_m4_decompose, computed directly with no matrix multiplies -- the usual way to build an object's or bone's world matrix from its pose.

CF_M4x4
CF_Quat
cf_m4_decompose
cf_quat_to_m4
cf_m4_translate
cf_m4_scale