AnimationTimeCallback
A function used to compute the local animation time for a ModelAnimation.
// Use real time for model animation (assuming animateWhilePaused was set to true)
function animationTime(duration) {
return Date.now() / 1000 / duration;
}
Content copied to clipboard
// Offset the phase of the animation, so it starts halfway through its cycle.
function animationTime(duration, seconds) {
return seconds / duration + 0.5;
}
Content copied to clipboard
Parameters
duration
The animation's original duration in seconds.
seconds
The seconds since the animation started, in scene time.