Is there a way to apply a Euler filter or something else to prevent flipping when using keyframed animation?
See Playground below for example.
I have many animations and they play back fine with 1x playback rate. But when slowing it down the flipped angles are noticable. Check the following example. By setting the playback rate to something low as 0.1 or 0.01 (use the button) you can see that the box flips at one point (angle go from negative to positive). The keyframes are my input data, can I preprocess it somehow to fix it?
However, it’s not clear to me how I would convert my input keyframes to quaternions in a way that would prevent unwanted flipping. Because I guess BJS already uses quaternions internally. So I would need to apply some magic on top of those quaternions, right?
My input data is in Euler angles and I cannot change that so I will need to process it somehow.
Have slowed down animation frame rate from 300 to 30 for purposes of example (line 25)
have used a dummy root so that in calculating the key values the actual root does not get rotated during these calculations but it doesn’t seem to matter after all https://playground.babylonjs.com/#Q4DS2X#10