Trying to create a model loader of some sort (DirectX)

Started by
5 comments, last by karwosts 13 years, 5 months ago
Hello all,

I'm trying to create a model loader of some sort for a project I'm working on. I've looked into .X and .FBX but I cannot use .X because it's native support in DirectX10 is dead so I can't do it the easy way and .FBX looks insanely complicated... I honestly don't know where to start! I've been searching on the Internet for the past 3 hours now!

All I need is the Vertex data, the Normal data, and the Texture UV data... I work with DirectX10 and 3ds Max 2011.

If anyone could give me some help or point me in the right direction I would really appreciate it!
Advertisement
Are you set on creating your own or would you consider using a free one? Assimp seems like it would do what you need.
[size=2]My Projects:
[size=2]Portfolio Map for Android - Free Visual Portfolio Tracker
[size=2]Electron Flux for Android - Free Puzzle/Logic Game
Sorry for the late reply;

I think I don't have to create my own but I think I should because I could really use the experience.

Thanks for the link to ASSIMP, though! I'll be checking that out.
OBJ is probably the easiest format to start with for beginners. It has a fairly simple spec and is pretty ubiquitous. It doesn't support some of the more complex things you might need from a format (LOD, animations, etc), but for beginners it should suit your needs pretty easily. I think most modelling programs have obj exporter as well.

I'd start with that if you just need something quick and fairly easy for a beginner.

[size=2]My Projects:
[size=2]Portfolio Map for Android - Free Visual Portfolio Tracker
[size=2]Electron Flux for Android - Free Puzzle/Logic Game
We all face this problem at some point in our GameDev. I used lots of external libraries at first, BUT they all had issues. In the end I sucked it up and wrote an export script for Blender, it wasn't as hard as I thought. Once I had my file format worked out, very close to .obj except I include materials in the same file. I just wrote the importer. Its worth the effort.

I'll be putting my scripts online soon for others to use. for now I can email it to you with my full import code in C++, if you like.

Cheers

Lee

Code is Life
C/C++, ObjC Programmer, 3D Artist, Media Production

Website : www.leestripp.com
Skype : lee.stripp@bigpond.com
Gmail : leestripp@gmail.com

That seems like a good idea. Would you mind pointing me to a tutorial of some sort to help me get started? I searched for a good half an hour now on Google and I couldn't seem to find any...

Edit: Did not see your post, mixmaster.

Sure thing, if you don't mind. My email is vinchenz(at)gmail(dot)com. I could really use all the help I could get. I can mess around in DirectX quite a bit now but I don't know where to start when I'm working from scratch.
Quote:
In the end I sucked it up and wrote an export script for Blender, it wasn't as hard as I thought. Once I had my file format worked out, very close to .obj except I include materials in the same file. I just wrote the importer. Its worth the effort.


I've gone down this path before, and while I can see the upfront appeal, I would now have to say I recommend against it. Using custom formats are fine for your game, but writing your own exporter I think is a bad idea. Back last year I thought the same thing and I made a really nice binary format, multiple uv levels, multitexture, vbo optimization, all kinds of nice goodies, and worked out an exporter from blender to put it all together.

Today blender is moving on to a totally new internal API and my original script that I spent weeks on is useless now.

I think it's much better to write a converter instead of an exporter, maybe from a common interchange format like collada.

You may think your toolchain will be static forever, but this is a big risk.

In the end let's say you write a blender exporter for your own format.

Want to upgrade to the latest version of blender? You're SOL.
Someone on your team wants to use 3dmax? You're SOL.
Want to try a new version of Maya? You're SOL.
Want to import a model you bought on the internet? You're SOL, unless blender can import it perfectly into the exact format it needs to be to be reexported, and this is still an unneeded hassle.

In all of the above cases you'd have no problems if you just made a converter for a common stable format. You can bet that every version of every modelling package out there will support some set of common export formats, and they'll be thoroughly stress tested and maintained to be up to date.

Just my opinion.


[size=2]My Projects:
[size=2]Portfolio Map for Android - Free Visual Portfolio Tracker
[size=2]Electron Flux for Android - Free Puzzle/Logic Game

This topic is closed to new replies.

Advertisement