Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a .mesh file with OGRE?

Tags:

mesh

scene

ogre

I'm relatively new to OGRE graphics engine, so my question may seem too obvious, but searching for relevant information was not successful.

Given:
I have an OGRE application with a scene created of some meshes, lights, cameras and textures. It is rather simple, I think. That all is represented by a tree of scene nodes(internal object).

The goal:
To save the full tree of scene nodes or, preferably, an indicated branch of nodes of the tree to a ".mesh" file. To be able load it later as any other mesh. The ".mesh.xml" format is also fine. How it could be done?

If not:
If the desired thing is not possible, what is normal way to create those ".mesh" files? And where I could find some guides for it?

like image 970
Nikolay Rys Avatar asked Nov 26 '12 11:11

Nikolay Rys


2 Answers

I think you're a bit confused: OGRE mesh file is a file that stores only geometric data of a given 3D model like positions, normals, texture coordinates, tangents, binormals, bone index, bone weights and so on. It also can store a subdivision of a single mesh in submeshes (generally based on the material), and each of them can have a reference to the proper material. In essence a mesh file only contains data on the models you would like to load on your game, nothing about the scene structure.

If you want to save (serialize) your scene, you have two choice:

  1. Write your own scene serializer.
  2. Using some library already provided by the OGRE community: for example DotScene format.
like image 106
enigma Avatar answered Sep 18 '22 19:09

enigma


There are Ogre .mesh exporters for programs like Blender. A quick google for Ogre .mesh exporters should help you.

like image 21
Jacob.Kincaid Avatar answered Sep 20 '22 19:09

Jacob.Kincaid