Page 1 of 1

How to load a dae model?

Posted: Sat Jun 03, 2017 8:20 am
by KevinLuo
Hi Masters!

I have one question about the attribute "COLLADA_CREATE_SCENE_INSTANCES". If I
disable this attribute, I can only load part of this model, perhaps only one object of
this model is loaded to IMeshSceneNode. If I enable this attribute,I can load all objects,
but the ISceneManager::getMesh() method will only return a pointer to a dummy mesh.
So I can't change any attributes of this mesh by setting material flags to this pointer.
How can I load the complete dae model with "COLLADA_CREATE_SCENE_INSTANCES" diabled ?

Best Regards!

Re: How to load a dae model?

Posted: Sat Jun 03, 2017 10:57 am
by CuteAlien
The problem is that Collada (.dae) isn't a mesh-format but a scene-format. So it doesn't create a single mesh with COLLADA_CREATE_SCENE_INSTANCES but creates scene-nodes instead. Irrlicht loader is a little bit strange here because it used the meshloader to load a scene (I don't know why it was written like that, before my time... but it's not easy to change so I never attacked this task). And without COLLADA_CREATE_SCENE_INSTANCES it simply loads the first mesh (would be nice to have an optionn which mesh to load I guess...). There is no option to load the complete scene and put it back into a mesh. You could maybe do something like that manually by runnning the CMeshCombiner from irrExt (https://sourceforge.net/p/irrext/code/H ... ene/IMesh/) on the nodes afterwards.

Re: How to load a dae model?

Posted: Sat Jun 03, 2017 5:39 pm
by Mel
Does COLLADA support skinning in Irrlicht? eventhough if it is a scene format, the skinning information seems to be stored there.

https://www.youtube.com/watch?v=z0jb1OBw45I&t=736s

Re: How to load a dae model?

Posted: Sat Jun 03, 2017 6:00 pm
by CuteAlien
Don't know, but probably not. At least I don't remember seeing it in that code. But that loader is rather huge, so maybe I missed it.

Re: How to load a dae model?

Posted: Mon Jun 05, 2017 1:59 am
by KevinLuo
CuteAlien wrote:Don't know, but probably not. At least I don't remember seeing it in that code. But that loader is rather huge, so maybe I missed it.
Thanks a lot!

Re: How to load a dae model?

Posted: Mon Jun 05, 2017 2:44 am
by KevinLuo
CuteAlien wrote:Don't know, but probably not. At least I don't remember seeing it in that code. But that loader is rather huge, so maybe I missed it.
By the way, what's the recommended model format when loading an animated mesh or a terrain mesh?

Re: How to load a dae model?

Posted: Mon Jun 05, 2017 8:00 am
by CuteAlien
My recommendation is to think about which features you needd first. And then make test-models with those features and test formats with them. Generally - b3d works well for animation (in combination with Blender and the exporter from STK: https://sourceforge.net/p/supertuxkart/ ... lender_25/). For static models with a single texture .obj is nice. I'm not sure about static-models with multiple textures. Probably you could also use b3d for that. But always depends on what you do (so there are also use-cases for Collada for example).