Help with calculate skinned models loaded with Assimp

Started by
-1 comments, last by Dev_NightDreamer 9 years, 6 months ago

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. smile.png
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. ohmy.png

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:

  1. Load the vertex bone data, so each vertex know, by what bone it is how much influenced (done! biggrin.png )
  2. Each frame:
    - Get the time, since the animation started (done! smile.png)
    - 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... biggrin.png)

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? unsure.png

Does anybody have good tips on this or something like that? blink.png

Good evening,
NightDreamer

This topic is closed to new replies.

Advertisement