Closed G0BL1N closed 1 year ago
Interesting. I'm fine with adding that bit of logic to the slerp method on Rotor3 -- though think it would probably be better to just make end and dot mut
and negating them instead of shadowing them (in all likelihood shouldn't matter anyhow).
Thanks for a quick reply, I created a pull request #153 with proposed changes.
Fixed by #153
When animating a model exported from most graphical editors, they assume that interpolation between two quaternions in keyframes should always take shortest path, despite their dot products having different signs. The problem is explained here, better than I ever could. To accommodate for this, additional condition should be added to slerp. Here's a pseudocode from gltf tutorial, for example:
However, in your library when using slerp on rotors, path selection depends on the dot product sign, which differs from the code that should be used to interpolate between quaternions, in, for example, gltf. But as I understand it, it's not just gltf, it's all 3d formats, but I could be wrong about that. Either way, it sadly makes ultraviolet unusable for animating gltf models. My quick&dirty fix was adding this:
To the slerp method. But I honestly don't know if it's idiomatic or how it performs. Maybe there should be another interpolation method that includes this, if performance is concern? If you think my solution is good enough, I could submit a PR, but I really don't know.