Importing skeleton and animation data
This recipe introduces two key improvements to our glTF Viewer: it now supports storing data for skeletons and animations, and it includes functionality to load this data from glTF assets using Assimp.
These enhancements are put to use in the following recipes, where they enable the implementation of mesh skinning and animations.
Getting ready
This recipe does not include a separate code example. Instead, it explains the modifications made to the utility code, located in the files shared/UtilsGLTF.h and shared/UtilsGLTF.cpp.
How to do it…
Let’s begin with the skeleton by defining the essential data structures needed to store it.
- First, we should add a way to reference transformations. The identifier
modelMtxIdis used to point to a specific matrix within theGLTFContext::matricesBuffer. This approach generalizes how glTF transformations are managed and accessed.using GLTFNodeRef = uint32_t...