EvilPudding / candle

C Game Engine
MIT License
371 stars 14 forks source link

Hi, can u teach me how to load fbx animation with ASSIMP and OpenGL GLAD? #12

Open lucasjinreal opened 2 years ago

lucasjinreal commented 2 years ago

Hi, can u teach me how to load fbx animation with ASSIMP and OpenGL GLAD?

EvilPudding commented 2 years ago

You mean in the engine, or just in general? Assuming the question is about a project you're working on from scratch, with ASSIMP, you just have to parse the structure to get what you want, if you're looking for skeletal animation, then you're going to need to loop through the mesh's mBones. Then you need to get the weights of each bone. Then, you can loop through the scene's mAnimations to get the keyframes. With that, you have the variables you need to animate things, how you connect that information with GL is a bigger question with many possible implementations. If you need more help you can email me, and I could give you a more in-depth explanation.

lucasjinreal commented 2 years ago

@EvilPudding thanks for your reply! I mean a mininal example on loading fbx with ASSIMP, and vis animation in OpenGL. I search a lot but can not find such a workable demo project. Some are outdated, or can not run on macOS.

Only find an example runing dae as animation, but same code, when I import FBX, the vertices are totally wrong, and animation not right.

Can I extract a minal example inside candle? I think you must have experiences succeed in import fbx and vis in opengl animation!

I am totally confused the demo I found can vis dae but when FBX totally wrong. I thought the process could be same, since ASSIMP general aiScene very well.

Please let me know if you can help me further!