Page 1 of 1

how to load .3ds files

Posted: Sat May 20, 2006 7:45 pm
by Ultimate_fusion
I used the tutorial to load the sydney.md2 file fine with the texture.
I replaced the .md2 file with a 3ds max model (.3ds) which the model loaded was all white.

I think the .3ds file has a texture inbuilt, so how do I load these files completely.

thanks for looking
UF

Posted: Sat May 20, 2006 11:29 pm
by ASPamd87
So far as i know the .3Ds file hasenĀ“t the textures included, just the Path and the settings of the textures...
In my Opinion, irrlicht will just find the textures, if they in the same Folder or .zip file like your .3Ds file!

Or try: node->setMaterialTexture/getTexture like in the Tutorials...

And last: Search the Forum!

Sorry for my bad English :-)

Posted: Sun May 21, 2006 12:01 am
by hybrid
Yes, indeed if your mesh was correctly textures (uvmapped) the loader should at least try to load the texture. If it does not find the file it will issue a warning to the console. Just read it there and post it if you don't understand what it tells you.
If you do not have textures, but still want to have colors in 3ds files you'll have to patch Irrlicht and recompile it. Patch file found on my web page.

Posted: Sun May 21, 2006 2:35 pm
by Ultimate_fusion
I have got the textures to load, but now I have 3 animations I want to put in.
idle, walk, run.

On all 3 of the models on still.

scene::IAnimatedMeshSceneNode* anms = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/run.3ds"));

this is what I use to load it.

Posted: Sun May 21, 2006 7:07 pm
by hybrid
No animation support in 3ds files. Use directx, md2 or milkshape for that.

Posted: Sun May 21, 2006 8:45 pm
by cr_itm
Hello,

this topic fits well for my problem. I also try to load an animated mesh file. The syndey.md2 file works well. then I created my own animation and converted it to a .x file. I have a viewer that play that .x animation, but when I try to get it working in Irrlicht, the model sits just there and does nothing, here is my code:

Code: Select all

IAnimatedMesh mesh = scene.getMesh("c:/temp/sydney.x");
IAnimatedMeshSceneNode node = scene.addAnimatedMeshSceneNode(mesh);

node.setFrameLoop(0, 30);
node.setAnimationSpeed( 30 );

node.setMaterialFlag( E_MATERIAL_FLAG.EMF_LIGHTING, false );

(it's java syntax, because Im using Jirr, this should be not the problem understanding what Im doing).


Does anyone has an idea why my model (.x) is not animated in the scene (I checked, that the .x file is correct and has an animation)?

Thanks a lot