google / filament

Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
https://google.github.io/filament/
Apache License 2.0
17.77k stars 1.88k forks source link

AnimatedTriangle.gltf does not rotate correctly #1716

Closed cx20 closed 5 years ago

cx20 commented 5 years ago

Describe the bug I tried to create a display sample of glTF model by filament v1.4.0 with gltf-test. However, the model does not seem to rotate as expected.

To Reproduce glTF/AnimatedTriangle.gltf + filament result: AnimatedTriangle

Expected behavior expected_screenshot

This model is expected to rotate seamlessly. https://github.com/KhronosGroup/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_006_SimpleAnimation.md

Desktop (please complete the following information):

prideout commented 5 years ago

Thanks! This is probably occurring in the last .25 seconds, when we slerp between the last quat and the first quat -- we aren't taking the shortest path between these two orientations.

This is my fault: when I fixed a NaN issue, I probably broke this corner case. We take an abs at the top of our slerp implementation, which obviates the check at the bottom. Will fix and add a unit test.

cx20 commented 5 years ago

Thanks, I have confirmed that AnimatedTriangle.gltf rotates correctly with the latest version of Filament. glTF/AnimateTriangle.gltf + filament result:

AnimatedTriangle

I updated the status of gltf-test. image