RTCSETGEOMETRYTRANSFORMQUATERNION(3embree3)

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

πŸ’… rtcSetGeometryTransformQuaternion β€” the embree3 glow-up

okay bestie, welcome to rtcSetGeometryTransformQuaternion(3) from the Embree Ray Tracing Kernels 3 era, and no cap this one is lowkey iconic πŸ¦‹ it lives in the rtcSetGeo...Quaternion(3) section of the manual and it is exactly what it sounds like: you're setting a transform, but the rotation part is a quaternion, so everything interpolates pretty. slay.


✨ NAME ✨

rtcSetGeometryTransformQuaternion β€” sets the transformation for a particular time step of an instance geometry as a decomposition of the transformation matrix using quaternions to represent the rotation. πŸ’«

like, it's giving "rotate this thing smoothly across time" and honestly? obsessed.


🌸 SYNOPSIS 🌸

#include <embree3/rtcore.h>

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

copy it exactly bestie, don't be creative with the signature πŸ™ˆ


πŸŽ€ DESCRIPTION πŸŽ€

so the way that rtcSetGeometryTransformQuaternion works is: it sets the local-to-world affine transformation (that's the qd parameter, mwah) of an instance geometry (the geometry parameter, hey girl) for one particular time step (the timeStep parameter, periodt).

and the transformation is specified as an RTCQuaternionDecomposition, which β€” iykyk β€” is 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. the classic example is a turning wheel 🎑 and honestly that's the whole vibe. no weird squishing, no ghosting, just smooth spin.

for more info about the decomposition, go look at RTCQuaternionDecomposition. also super important: the quaternion you hand over inside the RTCQuaternionDecomposition struct will be normalized internally, so don't stress about pre-normalizing it, the library is doing that for you 🫢

⚠️ for correct results, the transformation matrices for ALL time steps must be set either using rtcSetGeometryTransform or rtcSetGeometryTransformQuaternion. mixing both representations is not allowed. like, do not. it's not a vibe. pick one and commit bestie πŸ’€

and just so we're clear on the rules: spherical linear interpolation will be used, iff the transformation matizes are set with rtcSetGeometryTransformQuaternion. (yes, the original really says "matizes", we're keeping it, character for character, it's iconic in its own way ✨)

want to see it in the wild? for an example of this feature, check out the tutorial Quaternion Motion Blur. go look, it eats πŸ”₯


πŸ’– EXIT STATUS πŸ’–

if something goes wrong, on failure an error code is set that you can query using rtcGetDeviceError. so if it's acting up, that's where the tea is β˜•


πŸ¦‹ SEE ALSO πŸ¦‹

  • rtcInitQuaternionDecomposition
  • rtcSetGeometryTransform

okay that's the whole page, you're officially a quaternion motion blur girlie now πŸ‘‘ thanks for reading, this was the Embree Ray Tracing Kernels 3 edition of rtcSetGeo...Quaternion(3) β€” go forth and slerp responsibly, ily, bye πŸ’œπŸŒΈβœ¨

πŸ“¦ where this page comes from