Bind different 3d models to a main model with opengl and assimp

56 views Asked by At

I hope you're doing well. I am starting with OpenGL, and currently, I have been implementing Assimp to load 3D models and animations, and so far, everything is going well. However, now what I want to know is whether it is possible to have several FBX files and link them to a bone of a main model. For example, I have an FBX file

male_character.fbx , and I have another file

helmet.fbx , and I want to associate it with the character's head. Is this possible, or can it only be done with one file and different meshes? Additionally, I have attached a gif to show what I have accomplished so far using Android Kotlin, NDK (C++), OpenGL ES, and Assimp. Thank you for your assistance! enter image description here

I added several 3D objects to the character from the same file (meaning different meshes), but I started thinking, if a new item needs to be added later on, then the entire FBX file would have to be completely updated to include this new item. That's why I want to know if it is possible to do this with separate files.

1

There are 1 answers

0
KimKulling On

Yes, it is possible to add different models into one big scene. Bug this is not the common usecase the Asset-Importer-Lib was designed for. Assimp will import the model, provide an intermediate model as a so called aiScene-Instance, which contains all the needed data for rendering this model.

If you want to assemble a scne out of different data you need to implement this in your rendering environment:

  1. Create a global scene based on your framework
  2. Import a new model by using assimp
  3. Add the aiScene-Data to the global scene. I am using my own scene graph for doing this

Hope that helps.