Flexible mesh data formats accepted?

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
stenyak
Kobold
Posts: 39
Joined: Tue Feb 10, 2004 4:53 pm
Location: Spain
x 1
Contact:

Flexible mesh data formats accepted?

Post by stenyak »

I've read here that there are "Flexible mesh data formats accepted". But from what i've read, it's only possible to load .mesh files.
Is it possible to load at least the correspondent .xml files, instead of the .mesh binaries?
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

Build mesh data however you like, .mesh is there to make your life easier, not to constrain you.

There are numerous examples in the code of mesh data being built in code. Use MeshManager::createManual and populate the mesh data in any way you see fit. Just be aware of the limits that D3D9 enforces on you as regards vertex formats, see the VertexDeclaration class for full details.

The point of .mesh is that it's optimised, has precomputed bounds, precomputed edge lists and all sort of other things. That doesn't mean you can't bypass it, but if you're just building standard meshes I question why you would bother - all it will do is slow your loading process down. Anyway, if you want to load direct from XML all you have to do is exactly what the OgreXmlConverter does. You could even reuse the XmlMeshSerializer class if you wanted; but we deliberately put that outside OgreMain to discourage people from loading from sub-optimal formats like that.
User avatar
stenyak
Kobold
Posts: 39
Joined: Tue Feb 10, 2004 4:53 pm
Location: Spain
x 1
Contact:

Post by stenyak »

Ok thanks for the info.
User avatar
PeterNewman
Greenskin
Posts: 128
Joined: Mon Jun 21, 2004 2:34 am
Location: Victoria, Australia
Contact:

Post by PeterNewman »

I recently had to respond to a similar question. My response was something like: Some engines do the conversion at load time, some before load, but they all convert into an internal data format, even if they dont show it.
The advantage of doing the conversion before time is saving time later (convert once instead of many).

As for Ogre taking many formats, there are a lot of converters/exporters for modelling formats.
Post Reply