Having trouble loading x file

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
alinpopescu
Posts: 5
Joined: Sat May 19, 2012 5:57 pm

Having trouble loading x file

Post by alinpopescu »

Hi,

I'm having trouble displaying this direct x file http://www.fileshare.ro/e29916343

It loads fine in DXViewer, do you know what other format I could use?
Last edited by alinpopescu on Sat Oct 12, 2013 6:21 am, edited 1 time in total.
Christi258
Posts: 62
Joined: Wed Feb 06, 2013 12:11 pm

Re: Having trouble loading x file

Post by Christi258 »

I also had problems loading .x files.
How do you try to display it?
Try to load it as IAnimatedMeshSceneNode, that helped me to solve my problem!
alinpopescu
Posts: 5
Joined: Sat May 19, 2012 5:57 pm

Re: Having trouble loading x file

Post by alinpopescu »

I use the mesh viewer from the example files (09.Meshviewer).
It does this:

Code: Select all

 
scene::IAnimatedMesh* m = Device->getSceneManager()->getMesh( filename.c_str() );
scene::IAnimatedMeshSceneNode* animModel = Device->getSceneManager()->addAnimatedMeshSceneNode(m);
animModel->setAnimationSpeed(30);
Model = animModel;
 
CuteAlien
Admin
Posts: 9644
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Having trouble loading x file

Post by CuteAlien »

Seems like a bug in the X-loader. For static meshes you can try .obj format, for animated meshes .b3d usually works well. In most cases .X is also fine, don't know what is wrong in this case.
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
alinpopescu
Posts: 5
Joined: Sat May 19, 2012 5:57 pm

Re: Having trouble loading x file

Post by alinpopescu »

Can you fix this please and send me the patch. I need to export the mesh into skin mesh, no animation is required. What other formats do you know to work because I don't know any 3ds max exporter for the .b3d format.
CuteAlien
Admin
Posts: 9644
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Having trouble loading x file

Post by CuteAlien »

Sorry, I'm not going to find time for doing this myself (no time currently, way too much stuff on my todo already, I'm not very familiar with that code and not at all with .X format and debugging it with just a huge .X file is also pretty hard as it doesn't make a good testcase).

Other format that works well without animation is .obj. I don't know which other exporters there are in 3ds max - if you give me a list (by screenshot for example) I might see another format that could work. I think 3ds format is also supported by Irrlicht.
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
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Re: Having trouble loading x file

Post by christianclavet »

Hi, I'm using 3DS Max and use Fragmotion to export to .B3D to Irrlicht. I alway had trouble with the .X format (animation playback is 10 times slower than the other formats)
CuteAlien
Admin
Posts: 9644
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Having trouble loading x file

Post by CuteAlien »

Digging up this super-duper old thread. I still had the file around on disc and was bored, so I spend a few hours trying to figure out what's going on. And from what I can tell the matrixOffset in the weights in this file is just wrong. Joints have no parent joints so they should use local FrameTransformMatrix which is an identity matrix in this file. So matrixOffset should be the inverse of that (so also identity), but isn't.

The reason DXViewer works is likely that it ignores matrixOffset from the file and calculates it instead. Because if I do that with Irrlicht for this file then it also get's the correct values. But that's expensive to calculate and the reason files pre-calculate this in the first place, so not doing that.

Also tried a few more .X files (which are pretty hard to find these days..) and all others seem to be correct even when matrixOffset is used.

OK, let's put this thread back in it's grave ;-)
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