如何在 terrain 或 ogre 中显示其他网格,
how to show the mesh in terrain or others in ogre,
http://i.stack.imgur.com/kcOxx.jpg
看图片,我想在OGRE中实现类似的东西,但是我对此一无所知。
我现在正在尝试用OGRE做一个SLG游戏,第一步是展示网格。
我是一名中国学生,而且...我的英语成绩不是很好,在我的国家我只能找到关于 OGRE 的小文档。互联网上充斥着 Unity3D...感谢所有阅读我的问题的人。
一种方式
再添加一次对象的 .material 脚本。
material myMaterial
{
technique
{
pass solidPass
{
// sets your object's colour, texture etc.
// ... leave what you have here
polygon_mode solid // sets to render the object as a solid
}
pass wireframePass
{
diffuse 0 0 0 1.0 // the colour of the wireframe (white)
polygon_mode wireframe // sets to render the object as a wireframe
}
}
}
这当然会渲染对象两次,但我认为这只是为了调试目的,线条非常细,而且对象在某些部分与线框重叠。
通常的方式
将另一个 texture_unit 添加到对象的 .material 脚本中,该脚本包含大小与 UV 映射(您可以使用大多数建模软件导出)相同的白色细方块,具有透明背景
确保 .material 脚本在您创建的通道中启用了 alpha
scene_blend alpha_blend
scene_blend_op add
这让您可以选择您想要的线条类型。
来源:
同时检查 Material 脚本下的 OGRE Manual。它更深入地介绍了 material 脚本本身
http://i.stack.imgur.com/kcOxx.jpg
看图片,我想在OGRE中实现类似的东西,但是我对此一无所知。
我现在正在尝试用OGRE做一个SLG游戏,第一步是展示网格。
我是一名中国学生,而且...我的英语成绩不是很好,在我的国家我只能找到关于 OGRE 的小文档。互联网上充斥着 Unity3D...感谢所有阅读我的问题的人。
一种方式
再添加一次对象的 .material 脚本。
material myMaterial
{
technique
{
pass solidPass
{
// sets your object's colour, texture etc.
// ... leave what you have here
polygon_mode solid // sets to render the object as a solid
}
pass wireframePass
{
diffuse 0 0 0 1.0 // the colour of the wireframe (white)
polygon_mode wireframe // sets to render the object as a wireframe
}
}
}
这当然会渲染对象两次,但我认为这只是为了调试目的,线条非常细,而且对象在某些部分与线框重叠。
通常的方式
将另一个 texture_unit 添加到对象的 .material 脚本中,该脚本包含大小与 UV 映射(您可以使用大多数建模软件导出)相同的白色细方块,具有透明背景
确保 .material 脚本在您创建的通道中启用了 alpha
scene_blend alpha_blend
scene_blend_op add
这让您可以选择您想要的线条类型。
来源:
同时检查 Material 脚本下的 OGRE Manual。它更深入地介绍了 material 脚本本身