Hey dudes.
I'm using C++ with SFML + OpenGL (+ GLM) + Assimp and I'm currently working on an animation system for my first 3D game project and I'm struggling with bone animated 3D meshs and the Assimp library since a few weeks.
Since threads to this theme are rare on the internet, I decided to ask you guys. ^^
First of all, I wanted to say, that I can load and display static models with textures assigned properly.
Although the shaders for rendering to a different framebuffer and for post processing are working fine.
But I can't get some animation working flawlessly due to the fact, that I didn't understand some things in order to complete this task.
So, my main question is (which is moreover the main problem): How do I get one specific keyframe of the bones and get their transformations/rotations/scaling ?
My thoughts are:
- Load the vertex bone data, so each vertex know, by what bone it is how much influenced (done! )
- Each frame:
- Get the time, since the animation started (done! )
- Look up the "nearest" time stamp in the keyframe list (I didn't want to interpolate yet, just keyframe after keyframe for now )
- Calculate all transformations per bone for this specific keyframe in a 4x4 matrix
- Update transformation matrices in the shader (maybe done, can't test it... )
1. is done properly and I stuck with 2. since a few weeks now.
The problem is, so far I can define it, how can I look up one keyframe for each bone in Assimps "aiScene" and how do I calculate the per bone transformations?
Does anybody have good tips on this or something like that?
Good evening,
NightDreamer