How to create a .mesh file with OGRE?

混江龙づ霸主 提交于 2020-01-02 04:38:09

问题


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?


回答1:


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.



回答2:


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



来源:https://stackoverflow.com/questions/13563944/how-to-create-a-mesh-file-with-ogre

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!