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

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
Jolly Joker
Posts: 23
Joined: Fri Jul 13, 2007 6:08 pm

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

Post 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.
Last edited by Jolly Joker on Wed Aug 01, 2007 3:37 pm, edited 1 time in total.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post 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) !!! ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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:
Jolly Joker
Posts: 23
Joined: Fri Jul 13, 2007 6:08 pm

Post 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.
nrasool
Posts: 5
Joined: Tue Mar 30, 2004 12:16 pm
Location: London, United Kingdom
Contact:

Post 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?
A Good programmer never blames his tools, only himself
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post 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 !!!
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Strong99
Admin
Posts: 687
Joined: Fri Mar 31, 2006 7:06 pm
Location: Netherlands
Contact:

Post 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?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

hmm, maybe... ;)

Joker, what is your console output telling you then ???
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Jolly Joker
Posts: 23
Joined: Fri Jul 13, 2007 6:08 pm

Post 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:
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post 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:
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Jolly Joker
Posts: 23
Joined: Fri Jul 13, 2007 6:08 pm

Post 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? :)
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post 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... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Jolly Joker
Posts: 23
Joined: Fri Jul 13, 2007 6:08 pm

Post 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?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post 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)...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Jolly Joker
Posts: 23
Joined: Fri Jul 13, 2007 6:08 pm

Post 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:
Post Reply