Loading mesh from *.irr file

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
Ivo Georgiev
Posts: 27
Joined: Wed Dec 12, 2007 7:05 pm

Loading mesh from *.irr file

Post by Ivo Georgiev »

The title tels it all...I wanna load mesh from irrlicht file.My scene manager is called "scene_manager".
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The just do it. There's also an example (number 15) doing exactly this.
Ivo Georgiev
Posts: 27
Joined: Wed Dec 12, 2007 7:05 pm

Post by Ivo Georgiev »

But that example loads scene, not mesh...
shogun
Posts: 162
Joined: Wed Sep 05, 2007 11:02 am
Location: inside

Post by shogun »

.irr IS a scene format, not mesh format.
dejai
Posts: 522
Joined: Sat Apr 21, 2007 9:00 am

Post by dejai »

lets add this to the manual lol..
Programming Blog: http://www.uberwolf.com
Ivo Georgiev
Posts: 27
Joined: Wed Dec 12, 2007 7:05 pm

Post by Ivo Georgiev »

And talking for manual, is there any good manual around??I havent found nothing which can help me in the documentation :shock:
I know that is a scene format, but I wanna get the MESH out of it...there is mesh too!
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

It is pretty easy. You now know that the .irr format describes an entire scene, so
  1. Load the scene.
  2. Now that you have a scene, you need to locate the scene node that holds the mesh you wish to access. The scene manager has methods for locating nodes by name, type or id.
  3. Check the type of the scene node, and cast the scene node pointer to the correct derived scene node type.
  4. Ask the derived scene node for its mesh.
Of course the other option would be to just load a named mesh and access it directly.

Travis
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Ivo, there is absolutely no mesh "embedded" in the scene format.

You need also the mesh files.

Like:

B3D format
X Format
3DS format
IRRmesh format
COLLADA format
...

A IRR scene file will permit you to reload a series of mesh file and be reloaded at the position you placed them in IRRedit.
Ivo Georgiev
Posts: 27
Joined: Wed Dec 12, 2007 7:05 pm

Post by Ivo Georgiev »

Okay, I am sure you are write, but I will try screne_manager -> getMesh
dejai
Posts: 522
Joined: Sat Apr 21, 2007 9:00 am

Post by dejai »

Viron, you need to write a tutorial on this and then add it to your signature, it would save so much time :D Or just post something, feel free to add it into the irrlicht manual.. Just add chapter 11 on irredit if you wish :D

Also Ivo it wont work :D This question has been asked hundreds of times. I wonder why niko does not just make a mesh exporter for irredit, on the subject would it even be possible.
Programming Blog: http://www.uberwolf.com
Saypen
Posts: 11
Joined: Sat Dec 01, 2007 7:20 am
Location: Australia

Post by Saypen »

sceneManager->getMesh loads a mesh from an external file - when you load a .irr file it loads all the meshes and scene nodes automatically. Once you have loaded the .irr file you can get a specified mesh by:

Code: Select all

    
sceneManager->loadScene("scene.irr"); //load the scene

ISceneNode* node = getNodeFromName(name); //get the scene node from its name

//turn type ISceneNode into type IMeshSceneNode
IMeshSceneNode* meshSceneNode = (IMeshSceneNode*) node; 

return meshSceneNode->getMesh(); //return the mesh nodes mesh
this works only if you no the name of a node who 'owns' the mesh
"Internet, whats that?"
-Bill Gates
fuego2008
Posts: 22
Joined: Wed Sep 24, 2008 7:26 pm

Post by fuego2008 »

Saypen, I was in need of this code for very long. Your fragment of code saved my life. Great thanks
Post Reply