export 3d models from 3ds max into irrlicht

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
Arshia001
Posts: 6
Joined: Wed Nov 17, 2010 7:58 pm

export 3d models from 3ds max into irrlicht

Post by Arshia001 »

Hi all.

I've been looking for a good graphics/physics engine for quite some time. I've come across many engines, and spent a lot of time trying to get them to work. After maybe 2 months of looking into every graphics and physics engine I could get my hands on, I've come to decide that the best engine is by far... guess which one? :D
I've been playing around with irrlicht (and the irrBP wrapper for that matter) for quite some time now, and I gotta say it's great, or at least it's great until you decide to import your meshes...
I've been trying to get my (static) meshes from 3ds max 2011 into irrlicht for maybe two weeks now. I've tried every format I could think of, including .x,.3ds,.mesh (ogre), collada, etc,etc,... and every SINGLE ONE of them messes the model up in some way or another...
The specific model I'm trying to import (load, display, whatever :D ) is a free model of a lamborghini reventon I found online, which is similar in every way to what I'm hoping to get into the engine later(cars, ofcourse :D ). It includes transparent and texture mapped vertices. Now, the only format which came close to displaying correctly was 3ds (exported using the native 3ds max exporter), and it messes the locations of different parts of the model pretty badly. It actually put the windshield where the doors should be!
So, here's the million dollar question: using which format/exporter can I (successfully! :D )import my model into irrlicht? I need all data (including transparency which a lot of formats seem to mess up) intact ofcourse... I've tried so many ways I've lost count, but here are a few that didn't work:
Panda DirectX Exporter
Native 3DSMax 3DS exporter (the model loads fine in max, but gets messed up in irrlicht and blender)
Blender's OGRE mesh exporter plugin
Native 3DSMax OBJ exporter
Native 3DSMax COLLADA 1.4 exporter
Native 3DSMax STL exporter
...
So, it would be great if anyone could show me a way to get my models into irrlicht... It'd be the end of my search and I'd be able to start the real work, actually! :D

Thanx in advance!

P.S. Just tried md3 too, with no success...
Last edited by Arshia001 on Wed Nov 17, 2010 8:57 pm, edited 2 times in total.
shadowslair
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Post by shadowslair »

I`m pretty sure you`re doing something wrong while building the model in 3d Max. I personally have tried the .3ds, .obj, and .x and they work as expected for the static meshes, even with transparent materials set inside Max. I use the .b3d format freqently exported by 3d Max 9 SP2 via the Blitz3D Pipeline and the models are exported properly. :roll:

PS: It`s a good practice to test your model loaded with example 9- "09.Meshviewer" just in case you`re doing sth stupid in your app.
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
Arshia001
Posts: 6
Joined: Wed Nov 17, 2010 7:58 pm

Post by Arshia001 »

The panda exporter has a pretty nasty bug, no argument over that (I've used it in my own D3D9 code... terrible experience) but the 3ds exporter SHOULD work... Funny thing is, the model included both max and 3ds formats, and the provided 3ds file didn't work either (even in blender). I'm having a pretty difficult time trying to figure out what's going wrong...
Say, I'm gonna make a hunch and ask a noob question (I'm not really experienced with 3DSMax, I'm a programmer, not a 3D artist): How do you merge multiple parts of a model into one (non-explode-able) editable mesh? I think merging all the different parts of the model should do the trick...

P.S. I think I'm gonna use the mesh viewer example, in fact :D will post the results in a minute.

P.P.S. same results. :cry:
shadowslair
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Post by shadowslair »

I can try exporting your model for you if you wish, but I have Max 9, so I`m not sure I`ll be able to open it. About the "merging"- you can Attach one mesh to another if this is what you`re asking for..
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
Arshia001
Posts: 6
Joined: Wed Nov 17, 2010 7:58 pm

Post by Arshia001 »

Well, basically, that's what I'm talking about , but I have yet to test it.

I'm thinking about using a different free model, could be there's something wrong with the model :D
here's a link to the model I'm using anyway:

http://www.turbosquid.com/3d-models/lam ... del/389172

Another funny observtion: using panda exporter on the lambo model actually CRASHED DirectX Viewer.This keeps getting more fun by the minute.

Last observation for tonight: I couldn't reproduce the glitch with one of my own models. Either the models I downloaded use some technique that I'm unaware of, or the models aren't complex enough, or something like that, but the fact remains that my chess set was exported to 3ds successfully. I'd still love to know what caused the problem with the lamborghini, though.
shadowslair
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Post by shadowslair »

The lamborghini is using multi/sub materials that Irrlicht cannot display. That`s the only reason, and its due to the fact its made to be rendered inside max scene. You can change those or use another model. Plus, a 30,5k tris model may be too much for a realtime app. Here`s too late to start testing right now, but I got best results with the Max native OBJ exporter. Meaning- just loaded the max scene, selected all and exported to .obj creating a material library with the scene materials. Here`s what I got:

http://pics.data.bg/categories/1/%D0%BE ... 4/lamboobj

not that bad for "untouched" model I think.

PS: It`s nice to use textures that are power of two. Max has no problem with them, but some graphics cards may have.
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
Arshia001
Posts: 6
Joined: Wed Nov 17, 2010 7:58 pm

Post by Arshia001 »

Well, I noticed the problem with the materials. If I ever get to the stage of actually making something, I'm definitely going for one texture map per model, which should take care of our problem with the messed up colors.
In fact, what I was trying to import was the geometry and UV maps, and I just got it, thanks to you! You told me to use attach, and that's what I did, only I used attach GROUP, not attach mesh. I just used the attach mesh button, and I totally got it working! I love you man!
If you're interested in knowing what I was talking about before, I have a screenshot of what the lambo used to look like right here:

http://arshia.sharifce.ir/lambo.jpg

I almost have everything in place now. There's one last question to ask though: If I used one texture for the entire model, except for the windows which should get transparent material, it should look OK, right? (It does here!)
shadowslair
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Post by shadowslair »

Arshia001 wrote:If I used one texture for the entire model, except for the windows which should get transparent material, it should look OK, right? (It does here!)
Yes, it should be fine, even if you use 10 diffuse maps and with alpha channels or transparency- everything is tested and works in worst case mith minor material tweaks from Irrlicht. What was wrong with the materials inside Max was that the glossy paint look material and some others which I`m pretty sure were using shaders in order to be shown and rendered nicely. You cannot expect those to work inside Irrlicht as-is.

PS: Yes, you can attach mesh groups and on too. There was "Attach from list" (or sth alike) option too, which makes our life easier.
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

Else, the best way to export models correctly out of MAX is to write your own exporters and importers. There are good examples of maxscript in the maxscript help which are able to export and import models from/to MAX, And you have available the Irrlicht importers, so you have a good source to learn from.

It is not that easy, but that gives you full control over the data you export and import after, with a minimal chance of errors, and being able to solve those which arise in the process.

Learn maxscript. it is definately worth.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Arshia001
Posts: 6
Joined: Wed Nov 17, 2010 7:58 pm

Post by Arshia001 »

The attach from list option saved my life! there were maybe 200 pieces to the lambo. I hate to imagine the trouble I'd have to go through without the lovely little button. Attach group wouldn't fix the problem, attach mesh did, and I have absolutely no idea why.
Anyway, thanks for all your help, shadowslair. You saved me a lot of trouble.

Mel, I don't really see the point in learning a whole new language which happens to work with something I have terribly little knowledge of. Maybe after I manage to finish building my BMW 530 model... (Spline cages for the entire model... there's gotta be a nicer way to do it...!)
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

It serves when you find that the current exporters won't export all the data you need, or in the way you need. Or when you switch the version of MAX to anything newer and you find that you don't have an exporter which works exactly as you was acustomed to. Having the exporting problems solved inside MAX enables you to move forward without losing what you currently had :)

The "Attach list" button serves to add another mesh completely to the current mesh you are working with. The good part of this is that if the two meshes have diferent materials, BUT they share some, the attachment process merges the ID's so you have only diferent ID's which, when exported, translate into an smaller amount of meshbuffers (and a smaller amount of drawcalls when that object is rendered in Irrlicht :))
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Hi, Arshia.

I was able to export some meshes with animation with Panda and never had problem with it. But I made sure all the model had only diffuse textures. I think sub textures should perhaps work, but you will need to apply only diffuse texture. Materials should be created in Irrlicht anyway not in 3DS max. You only need a base material.
Arshia001
Posts: 6
Joined: Wed Nov 17, 2010 7:58 pm

Post by Arshia001 »

12 days of pure inactivity is what you get when you rely on the university's internet connection...

Anyway, the native 3ds exporter is working like a charm with my own meshes. I have a BMW 530 sedan (just the body) exported to 3ds and packed in a PCK file (an uncompressed package format I've been working on, doesn't sound awfully useful, I don't know if it's worth sharing), loading and displaying correctly while also colliding with the walls of the Quake 3 map. All thanks to Irrlicht, Bullet, the guy who made IrrBP, and you guys! I can't really express just how happy I am that I came across Irrlicht... Well, it IS kinda hard to miss if you're looking for an engine :D
Post Reply