It really is just a simple interpolation between two quaternions on the sphere surface in sphere relative space. You can use the squad interpolation function with two quaternions and just reconstruct back into sphere space. It is like 15 lines of code in one function.
In more detail:
Given you want the same side of the mesh touching at the start and end, we can just convert the matrices to be relative to the sphere center using the sphere coordinate space, and then extract their relative quaternions and translations. The orientation towards the center should be the same for both relative to the quaternion orientation. Thus we really just need to interpolate the quaternion using squad interpolation (https://github.com/AcademySoftwareFoundation/Imath/blob/8456...) while reconstructing the sphere-coordinate matrix at each step and using the quaternion-relative orientation.
This is a lot simpler and faster than the proposed multi-step algorithm.
Neat approach! For this kind of mesh animation on a sphere’s surface, another path worth exploring is quaternion-based orientation traversal. I’ve been experimenting with this in SpinStep[0] — a Python library that uses quaternions to step through spatial structures based on orientation rather than position.
It’s particularly helpful when you want smooth, rotation-aware transitions (like gliding across a sphere’s surface) without relying solely on angles or coordinate systems. Could be interesting to try a similar traversal heuristic in a Three.js context using Quaternion.slerp().
Yes it is! It was acquired by Webflow a few months ago. They made all its extra features free. I specialize in GSAP. It's common to see it used with three.js or SVG on high-profile sites.
[1] https://www.youtube.com/shorts/CpaXi9ije2k
reply