RTCQuater...mposition(3)

πŸ“¦ version 3.13.5, in epel 9, fedora 43, fedora 44

πŸ’– RTCQuaternionDecomposition(3) πŸ’–

okay bestie, sit down, hydrate, because we're talking about RTCQuaternionDecomposition β€” and yes, it's from Embree Ray Tracing Kernels 3, so you already know it's giving serious graphics-girl energy. ✨


🌸 NAME 🌸

RTCQuaternionDecomposition β€” it's a struct, and what it represents is a whole entire quaternion decomposition of an affine transformation. like, the whole vibe. the full breakdown. no crumbs. πŸ’…


✨ 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;
};

look at her. fifteen floats. a main character lineup fr fr. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so the tea is: this struct, RTCQuaternionDecomposition, represents an affine transformation that's been decomposed into three separate parts. not two. not four. three. periodt.

part one is an upper triangular scaling/skew/shift matrix:

$$ 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:

$$ 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, and the way we're repping it is as a quaternion:

quaternion_r + quaternion_i i + quaternion_j i + quaternion_k k

where i, j k are the imaginary quaternion units. 🧚

🫢 heads up bestie: the quaternion you pass in will be normalized internally. you don't gotta do it yourself, it's handled. iconic behavior honestly.

so the affine transformation matrix that corresponds to a RTCQuaternionDecomposition is TRS, and a point p = (p_x, p_y, p_z, 1)^T gets transformed like this:

pβ€² = T R S p.

not me staring at that equation like it's a love letter. πŸ˜­πŸ’–


and because setting all those fields by hand is so much typing (iykyk), these functions exist to make it convenient:

  • rtcInitQuaternionDecomposition
  • rtcQuaternionDecompositionSetQuaternion
  • rtcQuaternionDecompositionSetScale
  • rtcQuaternionDecompositionSetSkew
  • rtcQuaternionDecompositionSetShift
  • rtcQuaternionDecompositionSetTranslation

they all let you set the fields of the structure more conveniently. use them. your wrists will thank you. πŸŽ€


πŸ’€ EXIT STATUS πŸ’€

No error code is set by this function.

literally nothing. silence. no drama, no errors, no exit code. she simply does not set one. πŸ™ˆ


🌈 SEE ALSO 🌈

  • [rtcSetGeometryTransformQuaternion]
  • [rtcInitQuaternionDecomposition]

and that's the whole page bestie, we ate and left absolutely no crumbs πŸ“βœ¨ β€” this was RTCQuaternionDecomposition(3) from Embree Ray Tracing Kernels 3, and the footer is doing its lil truncated thing as RTCQuater...mposition(3) because even manpages get shy sometimes πŸ’…πŸ¦‹

πŸ“¦ where this page comes from