How to load and display a model at runtime


I have a model in a well known 3d format (like obj/fbx/dae/3ds).
The model is fully baked and the meshes in the model have various kinds of textures(diffuse, height, emmissive etc.)

How can I load such a model and render in my game?
I knew that Xenko can use Assimp and load a 3d model but I could not find any sample code to render the loaded model.

Thanks in advance.

Why not import it with game studio and load it from the game content?

1 Like

You can add the assimp dlls to your project …

1 Like

Further you can investigate the methods in the dynamic libraries which are generated with the game. You can learn a great deal from just examining what is available to you there.



1 Like

I cannot do it as I am generating the model at runtime.

is it generative or load from file?

It is a generated model.

Then it’s pretty easy, you just create a MeshDraw class, assign your data and add it to a Model class. like here:

or here:

1 Like