RTCQuater...mposition(3)
π RTCQuaternionDecomposition β a whole vibe (section 3, bestie) π
okay so bestie, welcome to the Embree Ray Tracing Kernels 4 manual, section 3. today we're talking about RTCQuaternionDecomposition, and ngl it's giving β¨math girlieβ¨ but I promise it's not that deep. sit with me π«Ά
πΈ NAME πΈ
RTCQuaternionDecomposition β a struct that represents a quaternion decomposition of an affine transformation. no cap, that's literally the whole thing π
β¨ SYNOPSIS β¨
struct RTCQuaternionDecomposition
{
float scale_x, scale_y, scale_z;
float skew_xy, skew_xz, skew_yz;
float shift_x, shift_y, shift_z;
float quaternion_r, quaternion_i, quaternion_j, quaternion_k;
float translation_x, translation_y, translation_z;
};
like. look at her. fifteen floats living their best lives. she's iconic, she's organized, she's the blueprint π
π¦ DESCRIPTION π¦
so struct RTCQuaternionDecomposition represents an affine transformation that's been decomposed into three parts. three! like a lil trio. main character energy fr fr π
part one is an upper triangular scaling/skew/shift matrix, and she looks like this:
$$ S = \left( \begin{array}{cccc} scale_x & skew_{xy} & skew_{xz}
& shift_x \\ 0 & scale_y & skew_{yz} & shift_y \\ 0 & 0 & scale_z
& shift_z \\ 0 & 0 & 0 & 1 \\ \end{array} \right), $$
part two is a translation matrix, and she's giving:
$$ T = \left( \begin{array}{cccc} 1 & 0 & 0 & translation_x \\ 0
& 1 & 0 & translation_y \\ 0 & 0 & 1 & translation_z \\ 0 & 0 & 0
& 1 \\ \end{array} \right), $$
part three is a rotation matrix R, but she's represented as a quaternion:
quaternion~r~ + quaternion~i~ i + quaternion~j~ i + quaternion~k~ k
where i, j, k are the imaginary quaternion units. (iykyk π§) and listen β the quaternion you pass in? it gets normalized internally. so don't stress about it, she handles herself π
so the affine transformation matrix corresponding to a RTCQuaternionDecomposition is TRS, and a point
p = (p~x~, p~y~, p~z~, 1)^T^
will be transformed as:
pβ² = T R S p.
periodt. that's the whole transformation. slay π
now, setting all those fields by hand is lowkey a lot, so these functions exist to make it convenient:
rtcInitQuaternionDecompositionrtcQuaternionDecompositionSetQuaternionrtcQuaternionDecompositionSetScalertcQuaternionDecompositionSetSkewrtcQuaternionDecompositionSetShiftrtcQuaternionDecompositionSetTranslation
they let you set the fields of the structure more conveniently. use them bestie, your future self will thank you π«Ά
π EXIT STATUS π
no error code is set by this function. that's it. that's the tea. nothing to report, everything's chill π
π SEE ALSO π
rtcSetGeometryTransformQuaternionrtcInitQuaternionDecomposition
okay that's the whole page bestie, go forth and decompose those transformations β¨π¦πΈ
signing off from the RTCQuater...mposition(3) footer β brought to you by Embree Ray Tracing Kernels 4 π mwah, stay iconic π
π¦ where this page comes from
- ubuntu stonking: libembree-dev 4.4.1+dfsg-2ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms