I’ve spent a few days wrestling with the best way to animate the process of unscrewing bolts along their local axes. I want to call a function which animates the removal of a bolt - something like this:
removeFixing(numberOfTurns:number, axis:("x"|"y"|"z"))
I’ve been unable to do this using the BABYLON.Animation functions. I can’t keyframerotation
, rotation.x
or rotationQuaternion
. So I’ve fallen back to using a beforeRender observable but I’m not sure that this is the optimum solution.
-
rotation
androtation.y
- they are dependent on the order of Euler axis and so the fixing animates from its initial to final rotations but not along the correct axis. -
rotationQuaternion
- I can’t animate a quaternion to rotate multiple times (more than 360 degrees). I made a hacky attempt to loop the animation in order to achieve multiple revolutions, but this too met with defeat.
I’d welcome your critique of my code - it might help someone else who gets stuck on animating local rotations around an axis.