Page 1 of 1

Load .x mesh to list ISceneNode

Posted: Wed Oct 15, 2008 11:07 am
by marian.ek
How load 3D-objects from x-format file to list<ISceneNode*> objList ?
May be one of you write own MeshLoader witch can do it?

Posted: Wed Oct 15, 2008 11:29 am
by sudi
ISceneManager::getMesh("YOUR MESH".x);

next time read th Docs!!!

Posted: Wed Oct 15, 2008 11:41 am
by JP
Yeah a .X file contains geometry which is handled within irrlicht as a single mesh. You can't load it into seperate scene nodes as standard. You certainly could rewrite the XFileLoader to handle it differently i guess so if you want to try that then go for it ;)

But i'm thinking you probably don't want to do it yourself so you'd be better off stating why you want your .X file as a list of nodes and we can suggest some ways of achieving it.

Posted: Wed Oct 15, 2008 11:42 am
by rogerborg
Presumably he's not that thick, but if not, I can't think what the question is about, especially since it's in Advanced Help.

Marian, are you asking a specifically about how to add nodes to an irr::core::list? What part of the list API are you having problems with?

Posted: Wed Oct 15, 2008 1:42 pm
by marian.ek
I want create 3D objects in modeler and add to my irrlicht scene (it's not problem), but my 3D objects contains elements which i want change (rotate or move) for example: in gauge.X i have two objects :gauge and needle, and i want load it to my scene and rotate needle. When I standard load file "gauge.x" i have handle to only mesh from file. I don't want create two .X file (gauge.x and needle.x) and load it separate to my scene. How solve this problem?
I think that solution is simple: I need other CXMeshLoader, which load object forom file and return list contains handle to object from file as *ISceneNode. How do it?

Posted: Wed Oct 15, 2008 2:16 pm
by JP
Well yes off the top of my head your two options are to write a new x file loader which will split the needle and the gauge into two seperate mesh buffers and allow you to transform them seperately or you load both of them as seperate models. The latter is obviously easier but you don't want to do that so good luck with the model loader, post your results and they may be useful to others too!

Posted: Wed Oct 22, 2008 7:19 pm
by hybrid
What about adding a bone to the needle and change the animation of the needle?