There are different ways of doing animations - the simplest is to have each mesh associated with a transform (matrix) - you update the transform and the mesh moves around (scaled, rotated and translated). However, this makes it difficult to create soft body effets - with smooth surfaces.
Skinned animations is a mixed of rigid skeletons and a mesh surface - similar to the human body - we have a skeleton under our body - as the skeleton moves so the skin on the surface. The animation principle for skinning is very similar - we create a rigid skeleton (called nodes) - each of which have a transform - we animate these using animation frames.
The Bee in the image below shows a single mesh which is getting animated by 112 bones - the different colors indicated the areas of the mesh which are influenced by different bones.
The `skin` is a mesh which `links` to the skeleton. However, instead of a single transform for each mesh, we have a transform for each vertex! Not just one transform, but typically 4. We average between the multiple transforms to create `smooth` deformations (when two vertices next to each other are influenced by different transforms they don't just snap or change sharply).
The model data for this tutorial uses a simple insect with wings - both the binary and ascii versions:
• Models (.glb) (Bee.glb ) • Models (.gltf) (Bee.gltf)
Details about the model:
Number of Meshes: 1
Number of Nodes: 112
Number of Materials: 1
Number of Textures: 5
Number of Animations: 3
Number of Skins: 1
At this point, we need to load:
1. mesh (collection of vertex data - includes positions, joint indexes and weights)
2. joint data (hierarchy/skeleton/nodes)
3. animatoin data (control/move the joints)
The concept of skinning might seem like a lot of work - adding extra transform data to each vertex - when you've got a complex skinned model with hundreds of thousands of vertices - it might seem impossible? However, with tools like Blender or Maya; it's easy to setup the skinned mesh/file data - these specialist modeling packages help manage the complexity of designing and setting the weights so the final animated data is perfect.
Loading in the Mesh Data
The mesh for the Bee is a single set of vertex data (single mesh) - you can have multiple meshes/animations/skins inside a glTF file - but for this example, we have only a single mesh/skin.
Visitor:
Copyright (c) 2002-2025 xbdev.net - All rights reserved.
Designated articles, tutorials and software are the property of their respective owners.