glTFでのアニメーション
glTFでアニメーション
colladaに引き続き、glTFでもアニメーションを行うことができた。
モデルの権利表記
配布元リポジトリ
https://github.com/TheThinMatrix/OpenGL-AnimationUnlicense license
https://unlicense.org/
glTFでanimationを行うときの注意点
nodeとjointとの関係のようなものは別の機会にまとめたいと思うが、注意点としては以下のようなものがある。
- inverse bind matrixはjointの順番に並んでいる
- animationのtargetはnodeの番号
- inverse bind matrixは親nodeからの継承も含めて計算されている
- rotationのQuaternionからの変換はwikiにある変換を用いればよい
Rotation formalisms in three dimensions - Wikipedia
colladaでanimationを行う際には
[Animation] colladaファイルの読み取りからAnimationを行うまで - Qiita
でまとめた通り
OBJECT SPACE | -> | BONE SPACE | -> | OBJECT SPACE |
geometry | b | p |
となるが、glTFでは
OBJECT SPACE | -> | BONE SPACE | -> | OBJECT SPACE |
geometry | b | p |
となる。