如何使用OGRE创建.mesh文件? [英] How to create a .mesh file with OGRE?

查看:330
本文介绍了如何使用OGRE创建.mesh文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是OGRE图形引擎的新手,所以我的问题似乎太明显了,但是搜索相关信息并不成功.

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

给出:
我有一个OGRE应用程序,其中的场景由一些网格物体,灯光,相机和纹理创建.我认为这很简单.所有这些都由场景节点树(内部对象)表示.

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).

目标:
要将场景节点的完整树或最好将树的节点的指定分支保存到".mesh"文件中.为了以后可以像其他任何网格物体一样加载它. ".mesh.xml"格式也可以.怎么做?

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?

如果不是:
如果无法实现所需的操作,那么创建那些".mesh"文件的正常方法是什么?在哪里可以找到一些指南?

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?

推荐答案

我认为您有点困惑:OGRE 网格文件是仅存储给定3D模型的几何数据的文件,例如位置,法线,纹理坐标,切线,双法线,骨骼索引,骨骼权重等.它还可以将单个网格的细分存储在子网格中(通常基于材料),并且每个子网格都可以引用适当的材料.本质上,网格文件仅包含您要在游戏中加载的模型数据,而与场景结构无关.

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. 编写自己的场景序列化器.
  2. 使用OGRE社区已提供的某些库:例如 DotScene格式.

这篇关于如何使用OGRE创建.mesh文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆