Sign in to follow this  
Jimfing

.obj mesh file format - best usage

Recommended Posts

Hi all, After some investigation, i've seen that the .obj file format is pretty widely supported among DCC packages (XSI, Max, Maya, Blender, etc). For my engine I don't want to be bound to one 3d package you see. The .obj format supports the concept of groups, which I see as 'submeshes'. But there's no concept of nodes in the file. So if I wanted to define, say attachment points on a mesh - how would I go about doing that? The gun turrets on a ship for example. I thought of giving a group a name such as "dummy" to specify points in the file that are 'dummy nodes', but can't get orientation from that. Anyone have any strategies for this? Thanks ps. I've looked at COLLADA, but decided it isn't really mature enough yet, and using the COLLADA DOM is a real pain in the ass and is too heavyweight for my needs. The 3ds format was my 2nd best choice. I also pre-process my art assets if that's any help.

Share this post


Link to post
Share on other sites
maybe you could save your game info in a seperate file.

but i have to say that i think the obj format sucks. first it looks pretty simple, then you see that every exporter generates a different file. its actually quite complex, so you might be better using the 3ds format, which also supports nodes, and most 3d software can read/write it.

Share this post


Link to post
Share on other sites
3DS really sucks though too... it doesn't even support normals! Thus you'll have to write yourself a smoothing groups -> vertex normals algorithm which is somewhat error-prone and hard to tell when you've gotten it right. That said, 3dsmax at least outputs *terrible* normals with it's OBJ exporter so you might have to write this anyways.

Other options are the model format that OGRE uses (which is set up for game-type uses), or a custom file format.

If you're looking for production-quality stuff, you're probably better off writing an exporter for your favourite modelling tool in one of their scripting languages (which is not terribly difficult).

Note that if you're just coding up some demos, whatever is easiest for you is fine. If you're writing a larger game you'll want to have tools that manipulate/convert meshes into their internal game representations and serialize them out to a binary file; all data loading at runtime should pretty much be just sucking in pre-generated binary images of your game data structures.

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