Sign in to follow this  
  • entries
    12
  • comments
    12
  • views
    8277

3d file formats

Sign in to follow this  
Orbital Fan

206 views

3d file formats:

Something that I've always struggled with is choosing a good 3d file format for games. In my programming life I have used:

*vrml
*3ds
*x
*collada
*custom format
*obj

That's the order in which I used them. Here's what I think of each one:

*vrml - quite alot of 3d apps can export vrml. Many don't do a good job. It's been some years since I last looked at this format, and from what I remember there was loads of features which weren't relevant to 3d games. I think it supports weighted bone animation.
*3ds - an old format with no weighted bone animation support. It's well supported though - almost an industry standard.
*x - specific to directx, so using this format in opengl is a pain. Very relevant to 3d games though and seems to be well supported
*collada - a new format in xml, that is attempting to be the industry standard for interchange between 3d apps. You can use "fcollada" to read/write the files. The format is attempting to support "everything".
*custom format - i wrote my own exporter for Blender3D, which used xml, was dead easy to import, and supported everything I needed. However if I wanted to use another 3d app, then i'd have to write an exporter for that one.
*obj - probably the most widely supported format out there. Doesn't feature hierarchies or animation or per-vertex colours (!!), etc.

It's always difficult to try and shape the non-custom files to your own requirements.

Currently I'm using the obj format - which doesn't allow for hierarchies or animation. You may ask then that that's a strange choice given my rejection of the other formats. My idea is to have 2 files:

*mesh files
*model files

The mesh files are the obj (or similar) files that simply describe the mesh data.
The model files reference the mesh files, and provide additional data - such as the hierarchies, behavior, properties, etc. The model files can simply be xml files, and can initially be authored by hand. Later on I'll obviously need some editor for easy construction of these files. The great thing about this system is that it can be used for both models (cars, characters, etc) and worlds/levels.

eg.



car_body.obj
100] posy=[0] posz=[100]>car_wheel.obj
100] posy=[0] posz=[100]>car_wheel.obj




In the above example, in though there are 2 car wheels, I'll only need to load the car_wheel.obj file once.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

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