Sign in to follow this  
Little Coding Fox

General Solution to writing model exporters?

Recommended Posts

Hey everyone. Lately the development of my game engine has been a bit slow 'cos i've been trying to think of a way to create exporters to my own 3D format in a good way, without having to write the same exporter for various modellers, so i thought about writing a model format converter. However, i have a bit of a hard time trying to figure out how to work with the COLLADA api's or the FBX api's, collada's 'cos i cant find a non-java-based api, and FBX's 'cos i cant find a tutorial that EXPLAINS things properly instead of mixing stuff and getting me all confused in the end. So my question is, do you guys know of a good way to write a model format converter that can convert both static and animated models to my own format? Sorry for writing such a strange post... i hope somebody can help me Sory for the trouble, and have a nice day!

Share this post


Link to post
Share on other sites
Here's how I'm doing it:

Like you I decided writing importer/converters was simpler than learning many app's APIs.

I decided on a simple binary model format of my own, which could be read straight into VBO without any changes.

Python is very well suited to writing simple parsers due to it's interactivity and easy use of functional stuff and lambdas. I use python to parse the external model formats and write out my simple binary format. I have a python class that takes the data in a standard format and writes the files. This means if I decide to change my file formats later I'll only have to change this class, instead of many exporters. As the exporters could all be in different weird scripting languages, this is much more appealing to me. [smile]

So far I've done halflife smd, brown ifs, and obj. I plan to do collada at some point soon, but I think I'll just use a markup parser like Beautiful Soup and just scrape out the bits I'm interested in, as opposed to using fcollada for example. I'm not interested in supporting the entire collada format - that's for the tool developers. I'll use the collada refinery to get the data in the form I need - triangle lists, vert attributes - then parse that and ignore the rest.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this