两年前,UM软件发布了一个名为UM Scene的模块,用于帮助用户构建逼真的仿真场景。该模块提供了一个丰富的素材库,用户可以随意组合调用。同时,软件也支持用户通过自定义操作来扩展素材库。今天,我们通过一个简单的例子为大家介绍基本流程。
1、请从用户群或官网下载最新版的UM软件主程序和UMSceneCollection.exe素材库安装包,并依次安装(以管理员模式)。素材库自动安装于UM软件的数据目录:“C:\Users\Public\Documents\UM Software Lab\Universal Mechanism\9\Scene data”。2、运行3DSmax程序,打开位于“C:\Users\Public\Documents\UM Software Lab\Universal Mechanism\9\Scene data\Samples\Skoda_Yeti\Autodesk3dsMaxModel” 目录下的Skoda_Yeti.max模型。(注:本例使用3DSmax2018+ Easy Ogre Exporter,其他软件如Blender、Maya、COLLADA、MilkShape 3D或 Assimp也是支持的。)
3、该模型由四个对象组成,我们先将其合并为一个。在场景管理器选中任一个对象,接着在视图窗口点右键,选择菜单Convert to | Convert to Editable Poly。
4、紧接着,在视图窗口点右键,选择菜单Attach。

5、然后依次其他三个对象,如有弹出窗口,请按下图设置。



7、选择主菜单File | Export | Export,指定一个路径(不含非法字符),选择Ogre Scene格式。


9、在指定目录下生成了一些文件和文件夹,于我们有用的信息位于bitmap、material和mesh三个文件夹。

10、新建一个文件夹,如:mycar,将bitmap里的所有图片、material和mesh文件夹里的文件复制到这个文件夹下,删除其余不需要的文件和文件夹。这里,我们将material文件也改了一下名:mycar。

11、用记事本打开mycar.material文件,将所有ambient、specular和emissive的前三项参数都设置为0。

12、在所有贴图文件名前方加入相对路径 mycar/。

13、复制“C:\Users\Public\Documents\UM Software Lab\Universal Mechanism\9\Scene data\Samples\User objects”路径下的SampleUserBase.xml文件过来,与文件夹mycar并列放置,重命名为mydata.xml。
14、示例文件中包含了三个素材,我们只保留一个,并修改名称和序号如下图。(注意:模型及材质名称需与material文件里的一一对应,序号需≥20000000,并确保唯一性)

15、将文件夹mycar压缩为zip格式,重命名为mydata.zip,与xml文件一致,这样我们就制作好了仅包含一个素材的自定义素材库。

16、复制mydata.xml和mydata.zip文件到“C:\Users\Public\Documents\UM Software Lab\Universal Mechanism\9\Scene data\User objects”路径下。

17、复制“C:\Users\Public\Documents\UM Software Lab\Universal Mechanism\9\Scene data\Samples\User objects”路径下的SampleScene.scene文件到“C:\Users\Public\Documents\UM Software Lab\Universal Mechanism\9\Scene data\Scenes”路径下,重命名为MyScene.scene。
18、用记事本打开MyScene.scene文件,这里引用了多个素材,本例我们只需要一个。

19、设置如下图,注意素材名称和ID需与xml文件保持一致。

20、运行UM Simulation,打开任一个模型,然后选择菜单Tools-Scenes,打开UM的场景管理器。

21、从UM的场景管理器中选择MyScene,右键-Make the scene active。


需要说明的是,这类场景并不参与动力学计算,只有在UM Sensors模块,才能被各类传感器识别,可用于高级驾驶辅助系统的仿真模拟。


此外,UM Quick Track模块实际就是基于这个功能实现的,能显示高精度的钢轨、扣件、轨枕和道床。

联合使用UM Scene和UM Quick Track模块,可让仿真显得更加逼真,欢迎申请试用。

本文查询关键词:069
相关素材