Page 1 of 1

could not load mesh,beause file couldn't be opened room.3ds

Posted: Sun Sep 23, 2012 4:20 pm
by caiten
hi,all
i try to example 08.SpecialFX but visual studio message error in screen dos:
could not load mesh,beause file couldn't be opened ::.../.../media/room.3ds

how to fix error???
help me :(

thanks

Re: could not load mesh,beause file couldn't be opened room.

Posted: Sun Sep 23, 2012 4:57 pm
by hybrid
Well, ... looks strange, and in general this is just due to a wrong working directory.

Re: could not load mesh,beause file couldn't be opened room.

Posted: Mon Sep 24, 2012 7:46 am
by caiten
i from vietnamese . my english is bad.
I download irrlicht -1.7.3 from http://irrlicht.sourceforge.net/downloads/
in directory's irrlicht-1.7.3 have directory media.i don't repair or remove anything

Re: could not load mesh,beause file couldn't be opened room.

Posted: Mon Sep 24, 2012 8:09 am
by hybrid
Yes, all the files are there. But when starting the example from somewhere, you have to make sure that the relative(!) path you give the application is correct from where you are. So to be sure move to the bin/win32-visualstudio directory and start the app by clicking, or change to that directory on command line and run the example. Then it should work.

Re: could not load mesh,beause file couldn't be opened room.

Posted: Mon Sep 24, 2012 8:19 am
by Cube_
I assume youa re using Code::Blocks and MinGW, either way the working directory is often set as the dir where either your source files or binary files are, thus try this file path "media/room.3ds"

also, make sure your media directory is in the folder where you have your source files. if that won't work try where the binary files are, or manually set the working dir to where you want it.

Re: could not load mesh,beause file couldn't be opened room.

Posted: Mon Sep 24, 2012 8:29 am
by utunnels
Hmm, I assume he just copied that example to another place like I did for the first time, in which case the media folder could not be found.

Because the paths are all hard coded in cpp files, you can simply edit them before compiling. They are usually in a pattern like "../../media/dwarf.x", just change that if you want your media folder to be in another place.

Re: could not load mesh,beause file couldn't be opened room.

Posted: Mon Sep 24, 2012 12:56 pm
by caiten
hybrid wrote:Yes, all the files are there. But when starting the example from somewhere, you have to make sure that the relative(!) path you give the application is correct from where you are. So to be sure move to the bin/win32-visualstudio directory and start the app by clicking, or change to that directory on command line and run the example. Then it should work.
i copy file main.cpp from example 8.specialFX.
i had run example 01 hello_world success.
When i research function getMesh(),i don't understand it.
in library IAnimatedMesh.h ,i look getMesh()

Code: Select all

virtual IMesh* getMesh(s32 frame, s32 detailLevel=255, s32 startFrameLoop=-1, s32 endFrameLoop=-1) = 0;
so,in example i don't see arguments
i had read tutorial in place :http://irrlicht.sourceforge.net/docu/example008.html

Re: could not load mesh,beause file couldn't be opened room.

Posted: Mon Sep 24, 2012 3:33 pm
by serengeor
I can't spot any getMesh function being used with no arguments in that sample. It's just that instead passing all of the values, default ones are used.

Re: could not load mesh,beause file couldn't be opened room.

Posted: Mon Sep 24, 2012 11:18 pm
by hybrid
You are mixing methods from different classes. You want to find the one from ISceneManager, which loads meshes. But the one you show is from IAnimatedMesh, returning a mesh pose at a certain animation.