-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gltf] Missing last frame during animation? #7387
Comments
This is an interesting one! If you play the Cesium timeline very, very slowly, the cubes will align perfectly. But, if you play the timeline at 1x or faster, Cesium will "skip over" a tiny window of time where the animation comes to completion, and end up in the dead space after the animation has finished. Basically Cesium is not "clamping" the animation to its final value. It properly assigns the "current" value during the animation, but then doesn't assign any new values after the end of the animation, so the final value is never set. If you've got a low framerate or a fast speed, your last animation frame could have happened at some point prior to the end of the model animation, and the very next frame could be off the end of it. That causes your model to get visually "stuck" near the end of the animation, on whatever frame happened to be the last one rendered before the time ran out. |
Thanks for the quick analysis and insight! Sounds like a pretty nasty sampling issue. I assume that a fix is probably not straight-forward...or what do you think? |
I didn't look at the code, but from the observed behavior only, I believe the fix would be to check if the current animation time is past the end of the model animation, and apply the final keyframe value from the model animation as if it were current. |
Hi folks
I recently discovered an unexpected behavior. The following lines of code don't seem to play the animation till the last frame (stop at the second-last maybe?):
Please verify that with the following model (one cube still, the other rotates by 90 degrees). Note, that there is no gap at the beginning between the cube. Once the animation has finished in Cesium, there is a slight angle between the cubes, which indicates that there is at least one frame missing. This is not the case in BabylonJS, where the the first and last frames look correct.
The model:
cube_rot_animOptimized_noAutoAnim2.zip
Some screenshots:
First frame Cesium
Last frame Cesium
Last frame Babylon
Thx a lot!
The text was updated successfully, but these errors were encountered: