RTCSETGEOMETRYTRANSFORMQUATERNION(3)

πŸ’… NAME

rtcSetGeometryTransformQuaternion β€” bestie, this one sets the transformation for a particular time step of an instance geometry, and it does it as a decomposition of the transformation matrix using quaternions to represent the rotation. Yes, that's a lot of words. We'll get through it together 🫢

This page lives in section 3 of the Embree Ray Tracing Kernels 4 manuals, and the title is that long boi up there, rtcSetGeo...Quaternion β€” the man page system truncated it because even it got tired πŸ’€


✨ SYNOPSIS ✨

#include <embree4/rtcore.h>

void rtcSetGeometryTransformQuaternion(
  RTCGeometry geometry,
  unsigned int timeStep,
  const struct RTCQuaternionDecomposition* qd
);

🌸 DESCRIPTION 🌸

Okay so. The rtcSetGeometryTransformQuaternion function sets the local-to-world affine transformation β€” that's the qd parameter, queen β€” of an instance geometry (that's the geometry parameter) for a particular time step (that's the timeStep parameter, we love a themed naming scheme πŸ‘‘).

And the transformation is specified as an [RTCQuaternionDecomposition], which is, quote unquote, a decomposition of an affine transformation that represents the rotational component of an affine transformation as a quaternion. Why do we care? Because this lets you interpolate rotational transformations exactly using spherical linear interpolation β€” like a turning wheel 🎑✨, which honestly ate.

Want the full lore on the decomposition? Go read up on [RTCQuaternionDecomposition]. And heads up: the quaternion you put in the RTCQuaternionDecomposition struct will be normalized internally 🧚 so don't stress about pre-normalizing it yourself.

⚠️ Okay bestie, this is the important one, no cap: for correct results, the transformation matrices for all time steps must be set either using rtcSetGeometryTransform or rtcSetGeometryTransformQuaternion. Mixing both representations is not allowed. Pick a lane, we don't do situationships here πŸ’€

And also: spherical linear interpolation will be used iff the transformation matrices are set with rtcSetGeometryTransformQuaternion. Iff means if-and-only-if. Iconic logic, periodt.

For an example of this whole feature in action, go check out the tutorial [Quaternion Motion Blur] 🌈


😭 EXIT STATUS 😭

On failure, an error code is set β€” and you can go query it with rtcGetDeviceError πŸ•΅οΈβ™€οΈ


πŸ‘€ SEE ALSO πŸ‘€

  • [rtcInitQuaternionDecomposition]
  • [rtcSetGeometryTransform]

Anyway, that's the whole page, mwah πŸ’– this one came out of the Embree Ray Tracing Kernels 4 manuals, section 3, and if you need to cite it, it's the rtcSetGeo...Quaternion(3) page. Go set some quaternions, you're gonna slay πŸ¦‹βœ¨

πŸ“¦ where this page comes from