google / google/filament

gltf animation has wrong orientation if rotation is non zero and no rotation sampler is used

Open
#6,311 1 comment 0 reactions 1 assignee Claimed by @bejado View on GitHub
gltf
Dominant language
C++
Stars
20.5k
Forks
2.3k
Avg merge
2d 14h
Merged PRs (30d)
83

Description

**Describe the bug**
object during scaling animation has wrong orientation if rotation is non zero and no rotation sampler is used. Setting a single rotation keyframe(resulting in a constant sampler) resolves the issue.

**To Reproduce**
Steps to reproduce the behavior:
1. load the file `keyframe_rotation_no.gltf`
[keyframe_rotation.zip](https://github.com/google/filament/files/10055922/keyframe_rotation.zip)

2. notice that when no animation is played, the beams are parallel
3. play the animation which uniformly scales one of the beams
4. the beams in the animation should be parallel but they are not. The animating beam now seems to have zero rotation.

**Expected behavior**
Since no rotation sampler is used, the rotation should remain unchanged between animating and not animating. This is the case in other gltf viewers such as donmccurdy's or babylonjs.
The file `keyframe_rotation_yes.gltf` has a constant rotation sampler and works as expected.

**Screenshots**
![Screenshot 2022-11-21 at 11 58 08](https://user-images.githubusercontent.com/5306238/203033861-d51a4ee2-d759-4382-bee7-cb0918c36134.png)
![Screenshot 2022-11-21 at 11 58 35](https://user-images.githubusercontent.com/5306238/203033919-56263f40-ea6c-4f6b-8e17-5dcfb752283e.png)

**Desktop (please complete the following information):**
- tested on filament-1.26.0, filament-1.28.3, https://google.github.io/filament/viewer/
- model exported by Khronos glTF Blender I/O v3.3.32

**Additional context**
We encountered this issue when trying to optimise our animations using gltfpack. We assume it removes animation tracks only containing a single keyframe that has no effect on the already set rotation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.