Load .x mesh to list ISceneNode

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
marian.ek
Posts: 6
Joined: Mon Oct 13, 2008 3:28 pm
Location: Poland

Load .x mesh to list ISceneNode

Post 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?
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

ISceneManager::getMesh("YOUR MESH".x);

next time read th Docs!!!
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post 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.
Image Image Image
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post 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?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
marian.ek
Posts: 6
Joined: Mon Oct 13, 2008 3:28 pm
Location: Poland

Post 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?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post 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!
Image Image Image
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

What about adding a bone to the needle and change the animation of the needle?
Post Reply