How to load a dae model?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
KevinLuo
Posts: 23
Joined: Sat Apr 15, 2017 6:08 am

How to load a dae model?

Post 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!
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: How to load a dae model?

Post 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.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: How to load a dae model?

Post 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
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: How to load a dae model?

Post 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.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
KevinLuo
Posts: 23
Joined: Sat Apr 15, 2017 6:08 am

Re: How to load a dae model?

Post 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!
KevinLuo
Posts: 23
Joined: Sat Apr 15, 2017 6:08 am

Re: How to load a dae model?

Post 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?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: How to load a dae model?

Post 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).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply