Ogre的模型.mesh里面包含了什么信息(也就是说结构是怎样的呢)?

Ogre程序加载mesh文件原理 <br />创建模型实体 <br />Entity* entObject = mSceneMgr->createEntity(“object”, “ogrehead.mesh”);<br />createEntity() (创建实体) 在当前场景中创建一个实体实例并返回它的对象指针,作为 SceneManager 类的一个成员函数,它有两个重载:<br />Entity * Ogre::SceneManager::createEntity (<br />const String & entityName, 阅读详情

Ogre的模型.mesh里面包含了什么信息(也就是说结构是怎样的呢)?

A:

OgreMeshSerializer.cpp

MeshSerializer::importMesh

// Find the implementation to use

MeshSerializerImplMap::iterator impl = mImplementations.find(ver);

if (impl == mImplementations.end())

{

OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Cannot find serializer implementation for "

"current version " + ver, "MeshSerializer::importMesh");

}

对不同版本mesh的兼容很有意思,读出此.mesh文件的版本,然后找一个对应的Serializer去加载。

clip_image002

clip_image004

找到了,OgreMeshFileFormat.h就是。

/** Definition of the OGRE .mesh file format

.mesh files are binary files (for read efficiency at runtime) and are arranged into chunks

of data, very like 3D Studio's format.

A chunk always consists of:

unsigned short CHUNK_ID : one of the following chunk ids identifying the chunk

unsigned long LENGTH : length of the chunk in bytes, including this header

void* DATA : the data, which may contain other sub-chunks (various data types)

A .mesh file can contain both the definition of the Mesh itself, and optionally the definitions

of the materials is uses (although these can be omitted, if so the Mesh assumes that at runtime the

Materials referred to by name in the Mesh are loaded/created from another source)

A .mesh file only contains a single mesh, which can itself have multiple submeshes.

*/

.mesh文件是二进制的(运行期读起来快啊!),以数据块的形式组织,很像3D Studio的格式。

一个数据块由3部门组成:

CHUNK_ID

LENGTH 单位是字节

DATA

一个.mesh文件包含Mesh本身的定义,也可以包含它用的materials(不包含的话就是运行期从另一个资源加载或者创建)。

一个.mesh文件只包含一个mesh,可以包含多个submesh。

具体请看此文件。大体上就是顶点信息(M_GEOMETRY),动画信息,骨骼信息,LOD (M_MESH_LOD)等。

clip_image006

MeshUpgrader 模型升级工具

MaterialUpgrader 材质升级工具

MeshSerializer ? 估计这个就是导出插件干的事了

Q: Ogre的导出插件都有哪些?最好用的一个是哪个?

A:

OGRE Exporters

http://www.ogre3d.org/wiki/index.php/OGRE_Exporters

OgreMax Scene Exporter

clip_image008

安装上了,3ds max 2010.多了OgreMax菜单。

导出后查看

clip_image010

有源码没?

貌似是要购买才行啊!

导出插件(非商业版)没看到源码!

clip_image012

Viewer倒是有!

clip_image014

http://www.ogremax.com/Documents/OgreMaxWinViewer/source-code.html#usingInYourOwnProject

Using OgreMax Scene Files in Your Own Project

  • If you haven't already done so, you will need to have TinyXML library somewhere, either on your system or directly in your project's source code directory. In either case, be sure you have compiled with the TIXML_USE_STL preprocessor definition, both when building TinyXML (if you use it as a separate library) and when using it in your project. Failing to do this will likely result in your program crashing. For Visual Studio, you can find the preprocessor definitions in the project properties dialog underC/C++->Preprocessor->Preprocessor Definitions.
  • Copy the OgreMaxPlatform, OgreMaxScene, OgreMaxModel, OgreMaxRenderWindowIterator, OgreMaxTypes, OgreMaxUtilites, ProgressCalculator, and Version .cpp/.hpp files from the Common/Code directory and paste them into your own project's code directory.
  • In your application, create an instance of the OgreMaxScene class and call Load(). This instance should exist for as long as you wish to view the loaded scene. When you are destroying your scene, before deleting the scene manager, be sure to callOgreMaxScene::Destroy() (if you have a static instance) or delete the OgreMaxScene object (if you have a dynamic instance) so that the internal objects are deleted in the correct order.
  • To obtain the "extra" data stored in objects call the OgreMaxScene::GetObjectExtraData() method, passing in the object. A pointer to the extra data is returned. The pointer does not need to be deleted. It will, however, be deleted if the OgreMaxScene that loaded it is deleted.
  • When there is a terrain in a scene, there must be a camera and viewport present in order for it to be loaded without errors. This can be achieved with implementing theCreatedSceneManager() callback, as is done in the viewer, and creating the necessary objects before the remainder of the scene is loaded.

Building and Running the Viewer From Source Code

  • Visual Studio 2005 or 2008 must be installed. Other versions of Visual Studio, such as Visual C++ Express, are untested.
  • The Ogre 3D header files and static libraries (along with Ogre 3D's static dependencies) must be available. Ogre 1.6.2 and 1.7.0 are the latest tested versions. Static library support can be disabled by defining removing OGRE_STATIC_LIB from the project preprocessor definitions. Also, the zlib.lib, zziplib.lib, freetype235.lib, FreeImage.lib, LibJPEG.lib, LibMNG.lib, LibPNG.lib, LibTIFF.lib, Plugin_CgProgramManagerStatic.lib, RenderSystem_Direct3D9Static.lib, RenderSystem_GLStatic.lib, Plugin_ParticleFXStatic.lib, Plugin_OctreeSceneManagerStatic.lib and OgreMainStatic.lib references in the linker settings must be removed, and OgreMain.lib added.
  • The Lua header files and libraries must be available. Lua support can be disabled by defining OGREMAX_VIEWER_NO_LUA in the project preprocessor definitions and removing the liblua.lib and libluabind.lib references in the linker settings. The precompiled viewer uses Lua 5.1.1.
  • The Luabind header files and libraries must be available. Note that Luabind depends on Boost. Lua support can be disabled by defining OGREMAX_VIEWER_NO_LUAin the project preprocessor definitions and removing the liblua.lib and libluabind.libreferences in the linker settings. The precompiled viewer uses Luabind 0.7 and Boost 1.33.1.
  • The header files and library for this modified Object-Oriented Input System (OIS) must be used. The latest official public release, will also work, though the gamepad mappings will not be correct if a 360 gamepad is used.
  • The wxWidgets header files and libraries must be available. The precompiled viewer uses wxWidgets 2.8.7.
  • The wxPropertyGrid must be available. The precompiled viewer uses wxPropertyGrid 1.2.11.
  • The OgreMaxWinViewer.sln project file may be loaded in Visual Studio and built.
  • Run the output OgreMaxWinViewer.exe file.
  • If creating a non-static build, the appropriate Ogre 3D DLLs must be present on your system in order for the viewer to be successfully run. Modify theOgreMaxWinViewerPlugins.cfg file to reference the appropriate plugins on your system.

OgreXmlConverter可以把mesh与xml互转!

clip_image016

clip_image018

也可以把.skeleton转为.xml文件。

clip_image020

clip_image022

OGRE中mesh文件信息解析及提取之一 用过OGRE的朋友应该知道mesh文件,它是 阅读详情

相关推荐

OGRE动画系统--OGRE中的mesh文件和skeleton文件解析

Ogre中的Mesh文件主要包含:共享的顶点信息、subMesh部分、skeleton链接文件、骨骼和顶点索引和权重信息、LOD信息、包围盒信息、subMesh名字列表、边缘信息、Pose动画信息、Extreams信息和Pose动画关键帧信息。 Ogre中的skeleton文件包含:骨骼混合模式、骨骼绑定信息、骨骼层次信息、骨骼动画信息以及骨骼链接信息(可以链接到新skeleton文件) Og

smsmn的专栏 1950

OGRE 1.0 至 1.7.3 更新日志

OGRE (Object-Oriented Graphics Rendering Engine) Change Log v1.7.3 [Cthugha] (08 May 2011) - MAINTENANCE RELEASE iOS: Remove the animation timer. Since DisplayLink is used by default now, this on

痞子龙3D编程 6757

用OgreMax插件从3ds max导出ogre模型文件(.mesh/.skeleton)

OgreMax是一个3ds max插件, 用来从3ds max中导出ogre格式的模型文件.  它的使用步骤如下:  1. 安装3ds max2. 安装OgreMax插件. 从http://www.ogremax.com/downloads中下载OgreMax并安装. 安装前确认下列组件已经安装,不然OgreMax插件无法正常工作:Visual C++ 2005 Runtime

maoxh的专栏 1万+

Ogre学习心得

1.ogre的资源文件用文本格式打开:.material    可编辑.mesh      不可编辑(需通过OgreXmlConverter.exe转换才可看).skeleton  不可编辑(需通过OgreXmlConverter.exe转换才可看).particle    可编

850

OgreXMLConverter(OGRE1.9)

OgreXMLConverter,OGRE中要用到的转换工具,使用的OGRE1.9版本,自己从SDK中拷贝的。本人纯菜鸟,开始不会用,后来找到。 使用参考方法http://blog.csdn.net/buku2010/article/details/19679601 (非菜鸟就不用看了)

ogre 1.10.12 的源码

ogre 1.10.12版本的源码,用于CMake编译成Visual Studio平台上面的ogre引擎。win10系统亲测可用。ogre官网链接下载的。

OgreXMLConver 说明 及 批量处理

.[OgreXMLConveter] OgreXML转换器能够将 .mesh 模型网格文件 和 .skeleton 骨骼文件 由XML格式转换为二进制格式,同时可以将其二进制格式转换回XML格式。它同时也允许你在将XML格式转换为二进制格式时设置LOD层级信息。 如果你的Ogre脚本资源中原本使用的就是XML格式文件的话,那么本工具则是Ogre运行时必须的。所以你能够在OgreSource包的

ad33k编程开发 1129

OgreXMLConverter命令行工具

OgreXMLConverter命令行工具,ogre中必备~~~~

每天花30分钟看OGRE--(12)Ogre的模型.mesh里面包含了什么信息(也就是说结构是怎样的呢)?...

11.Ogre的模型.mesh里面包含了什么信息(也就是说结构是怎样的呢)? A: OgreMeshSerializer.cpp MeshSerializer::importMesh // Find the implementation to use MeshSerializerImplMap::iterator impl = mImplementations.find(ver); i...

weixin_30770495的博客 278

OgreCommandLineTools_1.7.2.zip

OgreXMLConverter, OgreMeshUpgrader ,OgreMeshMagick

从数据手册到代码:一步步解读SC7A20寄存器配置与加速度值换算原理

本文详细解析了SC7A20三轴加速度传感器的寄存器配置与加速度值换算原理。从数据手册出发,逐步拆解关键寄存器设置,并推导原始ADC值到物理加速度的完整换算过程,帮助开发者深入理解传感器底层工作原理,提升嵌入式开发效率。

weixin_29179311的博客 373

Ogre3D Mesh转换到FBX格式

在做一个Ogre3d 模型和骨骼动画转换到FBX格式的工具。中间遇到种种问题,下面将主要思路记录下来。 转换Mesh比较简单,就是遍历MeshPtr,获取顶点和索引缓冲、获取UV坐标,然后按FBX SDK的格式重新定义,然后保存即可。这个比较好弄。

shangguanwaner的专栏 6504

STM32HAL库学习笔记九——LCD显示

本文不会对驱动编写做特别详细的描述,以记录CubeMX的部署流程为主。

weixin_44762233的博客 6923

OGRE -- Mesh的使用方法

在OGRE中,动态创建Mesh一般有两种方法:其一,通过ManualObject的ConvertToMesh,创建ManualObject是中间过程,ConvertToMesh过后,此创建的ManualObject就可以Remove掉了;其二,通过HardwareBuffer直接创建Mesh。第一种方法相对来说比较简单(就不多说了),下面具体说说第二种方法:   1. 创建Mesh:MeshP

jie357059570的专栏 1763

GPS从入门到放弃(一) --- GPS基础原理

GPS从入门到放弃(一) — GPS基础原理 GPS,全称Global Positioning System,已经广泛应用于我们的日常生活中了,现在的智能手机 里都会自带GPS定位功能。这是一个美国的全球定位系统,虽然我们现在也有北斗了,但毕竟GPS搞的早,所以先从它开始研究起。 整个GPS系统分三大部分: 地面站 卫星 接收机 地面站负责监控。它们通过接收、测量各个卫星信号,计算卫星的运行轨...

tyst08的专栏 2万+

微信小程序利用Echarts加载中国地图的步骤

微信小程序如何利用Echarts加载地图?可按照如下四个步骤进行。(阅读时间大概3分钟)。

成都都成 5292

Ogre加载mesh文件原理与路径分析

创建模型实体 Entity* entObject = mSceneMgr->createEntity(“object”, “ogrehead.mesh”); createEntity() (创建实体) 在当前场景中创建一个实体实例并返回它的对象指针,作为 SceneManager 类的一个成员函数,它有两个重载: Entity * Ogre::SceneManager::crea

poem_of_sunshine的专栏 1385

DRM驱动代码分析:展频 跳频

DRM驱动代码分析:展频 跳频

yuuu_cheer的博客 2684

自己做OGRE专用.mesh模型

http://blog.sina.com.cn/s/blog_5113a1690100a311.html 方法一: 首先给大家推荐一款免费软件DeleD 1.81 LITE。DeleD最擅长于室内环境的建模。在DeleD 3D Editor中提供了许多简单的物体,比如立方体,多边形,球,矩形,网格线,金字塔,柱面等等许多的东西,同时也包含一些常用的材质。你只需要

smart_graphics的专栏 3159

C#上位机实战:工业产线数据采集与监控系统开发(附源码思路)

模块化设计:四层架构清晰,各模块独立可替换,便于后期维护与扩展;稳定性强:支持断线重连、异常重试、并发采集,满足工业7×24小时运行需求;实用性高:覆盖产线监控核心功能,可视化组件适配工业场景,操作简单;源码可复用:通信类、采集服务、报警管理器等可直接复制到其他上位机项目。

这里只有干货:从 Modbus 通信到 MES 对接,从 YOLO 训练到工控机部署,带你搞定工业软件开发全流程。 1664

【QCA6174】QCA6174 DFS认证的时候会有概率信道不会跳转的情况,通常跳转成功概率只有25%问题分析及解决方案

Master设备需要测试的项目。

wgl307293845的博客 758

Ogre 附属工具

Mage小组 著 Email: norman_chen@163.com   renwind@163.com  QQ: 18725262 http://www.173d8.com http://blog.csdn.net/pizi0475 附属工具 MilkSha

在那西天取经的路上。。。 663

ESP32网络开发实例-开发环境搭建

NodeMCU-ESP-32S开发环境搭建 NodeMCU-32S 最强的ESP32 开发板非盗版或副厂的CH340。WiFi 蓝牙ESP-32 可用Arduino IDE ESP32-S 是一款通用型WiFi-BT-BLE MCU模组,功能强大,用途广泛,可以用于低功耗传感器网络和要求极高的任务,例如语音编码、音频流和MP3解码等。 此款模组的核心是ESP32芯片,具有可扩展、自适应的特点。两个CPU核可以被单独控制或上电。时钟频率的调节范围为80 MHz到240 MHz。用户可以切断CPU的电源,利用低

视觉与物联智能 3790
上一篇: 利用Ogre的渲染到材质技术实现Ogre截屏功能
下一篇: Ogre中手动创建mesh
性感花脸
博客等级 码龄20年 26粉丝 37原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址