TraDaG  1.0
Training Data Generator
OGRE Mesh Files

Table of Contents

OGRE uses its own format for storing and loading meshes. OGRE mesh files can be identified by the .mesh extension. It is a binary format that will be parsed by the OGRE resource managers.

Actually, OGRE also has an XML format for meshes (usually with a .mesh.xml file extension). These files are not directly readable by OGRE, but they contain a textual representation of the mesh vertices, faces etc. and can be useful for quick manipulation of meshes. OGRE provides the OgreXMLConverter tool to convert XML mesh files to the binary .mesh format and vice versa. Under Debian and Ubuntu, the converter is contained in the ogre-1.9-tools package.

Creating a New OGRE Mesh

This section will describe how to export meshes from Blender to OGRE's .mesh format. The meshes that are included in TraDaG were created with this method and Blender 2.76. Start at step 4 if you already installed the OGRE export add-on.

  1. Go to the Blender2OGRE BitBucket repository
  2. Download the file and place it in the add-on directory of your Blender installation (for more information on this add-on, refer to the file in the repository)
  3. Enable the add-on in Blender (File > User Preferences > Add-ons > type "ogre" in the search bar > check the checkbox of the add-on
  4. Open the file with the mesh you want to export to OGRE
  5. Go to File > Export > Ogre3D
  6. Make sure that "Export Meshes" is checked in the export options
  7. Start the export process by clicking the "Export Ogre" button (this may take a while)

Blender will probably produce a bunch of files. The important files containing the meshes are the .mesh and .mesh.xml files. Note that the .mesh files will only be produces if the OgreXMLConverter is available - otherwise, you will need to manually convert the XML files with the OgreXMLConverter.

Registering New Objects

When you have created a new .mesh file, you need to tell TraDaG that it exists.

  1. Place it in an appropriate directory that is accessible for TraDaG (e.g. resources/objects/)
  2. Open the config/resources.cfg file with your favorite text editor
  3. Make sure the directory with your .mesh file is in the list; if not, add it by appending a new "FileSystem=path/to/directory" line

If you use the CVLDWrapper class to perform your simulations, you need to add the file name (without the path) of the new mesh through the availableObjects function - then you can set it as the active object using the setActiveObject method.