Problems with loading x files

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
Ryssus
Posts: 5
Joined: Fri Sep 17, 2010 10:32 am

Problems with loading x files

Post by Ryssus »

Hi. I tried to load x file exported from blender. When I use meshviewer everything loads fine, the model looks just as I wanted so as all the textures. But when I try to load it by myself, everything is messed up. Textures are on opposite sites of walls and it doesn't look like one I made. What am I doing wrong? Can someone write code to load x file?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

You have to show us your code, otherwise we have no way of seeing what you did wrong.
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
Ryssus
Posts: 5
Joined: Fri Sep 17, 2010 10:32 am

Post by Ryssus »

In irrlicht media folder is file dwarf.x. To load this file I simple use

Code: Select all

AnimatedMesh* mesh = smgr->getMesh("xxx/irrlicht-1.7.1/media/dwarf.x");
scene::IMeshSceneNode* Model = 0;
Model = smgr->addMeshSceneNode(mesh->getMesh(0));
All works fine, but dwarf doesn't move and it is what I wanted (I hope). But when I try to use it with my file, mesh loads but it is messed as I wrote earlier.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

Code: Select all

mesh->getMesh(0)
I think this returns a mesh from dwarf file at the first frame, so it wound get animated, and you should use IAnimatedMeshSceneNode instead of IMeshSceneNode.
Working on game: Marrbles (Currently stopped).
Ryssus
Posts: 5
Joined: Fri Sep 17, 2010 10:32 am

Post by Ryssus »

Yes, that's what I wanted to say. But my scene is static, so the code I posted earlier should work, but it doesn't.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Simply load it as animated mesh and set the animation speed to 0. Will also be static. And don't use octree on those meshes, that will in most cases not work.
Post Reply