Page 1 of 1

[slvd]What is the best mesh format that works with Irrlicht?

Posted: Tue Jul 31, 2007 8:45 pm
by Jolly Joker
I tried to import and display many mesh formats like .X, .B3D, .3DS but there are problems of loading textures, Irrlicht doesn't load textures automatically (this doesn't happen with BSP meshes).
Please tell me how to solve this problem?
What is the best mesh format that works with Irrlicht (except BSP)?

Thanks.

Posted: Tue Jul 31, 2007 10:43 pm
by Acki
it depands on the mesh type (static or animated) for static meshes mainly all types are good but my3d is the only one that supports light maps...
for animated meshes I think .X and .ms3d are a pretty good choice...
and I don't remember a format that doesnt load the textures automaticaly :shock:
just be sure the textures are in the same folder as the mesh (and for 3ds be sure the texture names are in 8.3 DOS style) !!! ;)

Posted: Tue Jul 31, 2007 11:46 pm
by hybrid
b3d also supports lightmaps and is pretty fast and well supported for animated models.
md2 does not load textures automatically, although I have a patch which should be commited soon :oops:

Posted: Wed Aug 01, 2007 11:48 am
by Jolly Joker
Thanks for your replies.

To Acki: I tested with .x, .b3d, .3ds. When I export map from DeleD, there are many texture files, I placed them in same folder with the map, but it doesn't load to my program, what I see is just a white object. I tried Mesh Viewer and it has the same result so I don't think the problem is in my code :) If you ever loaded a map successfully, please post a sample code :oops: I don't want to use BSP because there must be too many additional steps to create it.

Posted: Wed Aug 01, 2007 12:02 pm
by nrasool
Hi there, In the mesh viewer, do you see a white box? If so, then it means it is not loading up the textures which is the problem. I can successful load up an .b3d file without any problem, so it may be a problem with your model. Have you checked to see where you are reference the model, that the texture images are in the same place?

Posted: Wed Aug 01, 2007 12:23 pm
by Acki
Well, I really don't know what you're doing wrong...
It should work with no problems like shown in the tutorials...
I suggest you to make a test with the model(s) that comes with Irrlicht... ;)
for example the dwarf.x

Code: Select all

IAnimatedMesh* mesh = smgr->getMesh("path/to/Irrlicht/media/folder/dwarf.x");
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(mesh);
node->setMaterialFlag(EMF_LIGHTING, false);
this should really work with no problems !!!

Posted: Wed Aug 01, 2007 2:28 pm
by Strong99
:roll: he means that they're not loading, are you sure the path to textures is correct instead the model uses the path were the textures were first?

Posted: Wed Aug 01, 2007 2:35 pm
by Acki
hmm, maybe... ;)

Joker, what is your console output telling you then ???

Posted: Wed Aug 01, 2007 3:33 pm
by Jolly Joker
Wow thanks to all for your help, especially Acki for your code :twisted: I tried to load .dmf, .obj files successfully. The problem is I'm using C# and I did not call setMaterialFlag(), so the output is like this (console says that textures loaded successfully) :oops: what a shame :oops:

Image

Now it works :twisted:

Image

Thanks to all again :wink:

Posted: Wed Aug 01, 2007 3:46 pm
by Acki
I'm glad you got it now... ;)
Jolly Joker wrote:what I see is just a white object.
but as seen on your screen shots it's not white, but it's black !!! :twisted:
with this info we probably solved the problem faster, because a black mesh mostly depands on a missing light source !!! :lol:

Posted: Wed Aug 01, 2007 5:46 pm
by Jolly Joker
Yeah :oops: Sometimes it display as white but I didn't take a screenshot :P

I have another question: Can I read from a file (text or xml) an array of waypoints, and use it to move camera (like the demo program does)? Is there any trouble converting string to float type?
To create this array, a current position of an active camera may be required (example situation: create this array from a visual editor). Is there any way to get current camera position? :)

Posted: Wed Aug 01, 2007 6:19 pm
by Acki
yes, all is possible !!! ;)
Irrlicht also has a XML reader/writer implemented (don't know how to use it, because I use tinyXML), but there should be no problem to read floats with...

and it's very strange, but then you can get the cam's position with cam->getPosition()... :lol:

to follow the path you then can use createFollowSplineAnimator(...) (like the demo does)...

for further information have a look at the docu, it's really a magical file... ;)

Posted: Thu Aug 02, 2007 8:50 pm
by Jolly Joker
Thanks Acki, I'll test it tomorrow :)
I saw in your website some GUI extensions, are these available to use for .NET?
I have a problem with IGUIStaticText control: When text is longer than the control dimensions, I can't see the rest because there is no scroll bar, how can I fix that?

Posted: Thu Aug 02, 2007 9:41 pm
by Acki
I doubt they work with .NET, but I never tested it because I don't own .NET, sorry... :cry:

But you can try it, unfortunately you'll have to edit the sorces "by hand" then... ;)
If you install my IrrExtensions you'll find a folder named "tools" and in there are the tool files...
they are simple XML files and you should have no problems to read them (e.g. with text editor) and see how to edit the sources... ;)

but for the static text prob I also have no solution, I never saw a static text that has a scroll bar, regardless what sdk...
only solution would be to set the dimensions large enough and/or set it to multi line (wordWrap = true)...

Posted: Mon Aug 06, 2007 8:41 am
by Jolly Joker
Well that's ok, I'll try to find another solution :wink:
Now I'm working with a minimap and don't have any idea about this :( I'm thinking of a solution that reduces Z axis, only use X and Y, but it's still hard to do :cry: