【问题标题】:how to show the mesh in terrain or others in ogre,如何在ogre中显示地形或其他网格,
【发布时间】:2015-09-27 08:09:22
【问题描述】:

http://i.stack.imgur.com/kcOxx.jpg

看图,我想在OGRE中实现这样的东西,但是我对此一无所知。

我现在正在尝试用 OGRE 制作 SLG 游戏,第一步是展示网格。

我是一名中国学生,而且...我的英语成绩不好,在我的国家我只能找到一个关于 OGRE 的小文档。互联网上充斥着 Unity3D……感谢所有阅读我问题的人。

【问题讨论】:

    标签: mesh ogre


    【解决方案1】:

    一种方式

    再一次添加到对象的 .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
    

    这让您可以选择所需的线条类型。

    来源:

    还要检查材质脚本下的OGRE Manual。它更深入地介绍了材质脚本本身

    【讨论】:

    • 太好了,谢谢你的帮助。另一个问题:Ogre2.1在linux和windows下很稳定,比1.9快很多。 2.1material部分和1.9一样吗?
    • @luoyi 我不确定。但如果你刚开始使用 Ogre,我建议你暂时避免使用 2.1 版本并使用 1.9。 Ogre3D Tutorials页面上的大部分代码sn-ps在2.1版本中都会产生错误,学习引擎会困难得多。
    猜你喜欢
    • 1970-01-01
    • 2012-12-19
    • 2014-03-28
    • 1970-01-01
    • 2019-02-17
    • 2019-05-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多