What object format must I use for my world ?

Started by TBone, March 18, 2004, 07:38:13

Previous topic - Next topic

TBone

Hi,

I'm building an Air Traffic Control simulator. It's OK for the ATC engine side but I will begin the OpenGL side (with LWJGL) and I'm a newbie.

For the story, the player is on the Control Tower (viewpoint fixed but can rotate). You see the airport, the aircrafts, the buildings and neighborhood on 20nm max.

I have some difficulties to select a 3D file format. For now, objects are only cubes and not textured, viewpoint fixed but it can't continue :)

I have designed the first airport and aircrafts with LightWave3D 7.5. But I plan to use also Maya 5.

In a first step, I would like to see objects with colors only but in a second step I would like to paint them with a texture.

This file format should store:
- the geometry (of course :) )
- the color/texture references
- modifiers to move vertex for basic operations (like moving 2 vertices to simulate the aileron or rudder movement e.g.)

Could you help me to select a good file format ? Because for now I use a self-made XML format but texturing is a complex part for me.

Thanks for your time.

fbi

Hmmm...hamletic problem indeed  :D
I think that creating a custom file format (e.g. XML-based) might be a good option but, as you noticed, sometimes it might be not  :?
Anyway the so-loved (or so-hated) ASE file format is a good candidate for what you're looking for.
Moreover if you have some familiarity with the Max SDK for example, you could take a look at a Discreet technology called IGame which simplifies exporting data straight from Max (there's an example using an XML-based format).
You said you're currently using Lightwave so I suspect you can't use ASE file format  :)
Another option might be using some good old VRML2.0 but at the cost of having very simple materials...

TBone

I will check the Discreet IGame but I'm not a Max user.
In the worst case, I will continue my own XML format :)

thanks.

spasi

TBone, you may find that most XML parsers are slow/produce too much garbage. Therefore, I'd recommend using a custom, non-XML, format. It's more work, but worth the effort (given lots of data).

princec

I recommend sticking with XML, but serializing them ahead of time when you deploy your game, so they're in a Java-native object format.

Cas :)

TBone

spasi> my objects are not large. parsed in SAX it's quickly done. For now it's a classic XML file, later XML should be zipped.

princec> I have not serialize any object for now, I must try some tests about this.

TBone

Hi,

After coding few tests, I will continue with this (for now :) ):

In order to have a 3D object, I must:
- model this object with Lightwave3D
- export the object into OBJ
- use my OBJReader to translate the object into a more readable format : XML (where the user can change what he wants (colors, textures, ...)
- use my XMLObjectSerializer to build an object from the XML and serialize directly the object on disk. (batch operation before a release)

To do: texture management and vertex operations.

Thanks for your advices.

[edit: DXF->OBJ to have materials]

elias

Can't you script lightwave3d? If you could, you could avoid dicking around with the OBJ format, and export directly to xml.

- elias

TBone

mmhh... yes, I could.

I need to learn one more stuff, but I need to learn a lot of things so one more... :)

thanks for the tip.

TBone

elias> thanks for the tip, it works fine. it's not too difficult to script LW3D.