`
java-mans
  • 浏览: 11421559 次
文章分类
社区版块
存档分类
最新评论

OGER SDK研究之三 Demo_SkyPlane 天空面

 
阅读更多

SkyPlane.h

/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/

Copyright (c) 2000-2006 Torus Knot Software Ltd
Also see acknowledgements in Readme.html

You may use this sample code for anything you like, it is not covered by the
LGPL like the rest of the engine.

-----------------------------------------------------------------------------
*/

/**
/file
SkyPlane.h 天空面
/brief
Specialisation of OGRE's framework application to show the
skyplane feature where a fixed constant-distance
skyplane is displayed in the background.
//加入一个天空面
*/

#include "ExampleApplication.h"

class SkyPlaneApplication : public ExampleApplication
{
public:
SkyPlaneApplication() {}

protected:
// Just override the mandatory create scene method
void createScene(void)
{
// Set ambient light
//设置环境光
mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));

// Define the required skyplane
//面
Plane plane;
// 5000 world units from the camera
//设置高度
plane.d = 5000;
// Above the camera, facing down
//设置法向量
plane.normal = -Vector3::UNIT_Y;
// Create the plane 10000 units wide, tile the texture 3 times
//由自定义面创建天空面。
mSceneMgr->setSkyPlane(true, plane, "Examples/SpaceSkyPlane",10000,3);

// Create a light
//创建一个灯光
Light* l = mSceneMgr->createLight("MainLight");
// Accept default settings: point light, white diffuse, just set position
// NB I could attach the light to a SceneNode if I wanted it to move automatically with
// other objects, but I don't
//设置灯光的位置
l->setPosition(20,80,50);

// Also add a nice dragon in
//由模型文件创建一个实体并加入场景
Entity *ent = mSceneMgr->createEntity("dragon", "dragon.mesh");
mSceneMgr->getRootSceneNode()->attachObject(ent);

}

};

SkyPlane.cpp:

/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/

Copyright (c) 2000-2006 Torus Knot Software Ltd
Also see acknowledgements in Readme.html

You may use this sample code for anything you like, it is not covered by the
LGPL like the rest of the engine.
-----------------------------------------------------------------------------
*/

/**
/file
SkyPlane.cpp
/brief
Shows OGRE's skyplane feature where a fixed constant-distance
skyplane is displayed in the background.
*/

#include "SkyPlane.h"

#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
#endif

#ifdef __cplusplus
extern "C" {
#endif

#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
#else
int main(int argc, char *argv[])
#endif
{
// Create application object
SkyPlaneApplication app;

try {
app.go();
} catch( Ogre::Exception& e ) {
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL );
#else
std::cerr << "An exception has occured: " <<
e.getFullDescription().c_str() << std::endl;
#endif
}

return 0;
}

#ifdef __cplusplus
}
#endif

分享到:
评论

相关推荐

    Oger_3d_1.7_beginner's_guide中文第一章

    Oger3d1.7版本的初学者指南, 基本上就是step by step 模式,非常适合刚接触oger的童鞋

    超强OGRE中文教程bychenhong

    这是目前我能找到的最有实际意义的ogre教程,不泛泛而谈,而是面向实用,在这里向原书作者表示深深的感谢。

    易语言模块易语言OGRE类库1.1.rar

    易语言模块易语言OGRE类库1.1.rar 易语言模块易语言OGRE类库1.1.rar 易语言模块易语言OGRE类库1.1.rar 易语言模块易语言OGRE类库1.1.rar 易语言模块易语言OGRE类库1.1.rar 易语言模块易语言OGRE类库1.1.rar

    ogre最新技术

    ogre最新技术,最新开发文档资料,供初学者学习

    ogre 易语言指南

    ogre 指南编写改造的易语言指南,适合初学者使用。请阅读 有很多很有价值的内容 。讲得也很清楚。

    OGRE-草地的制作

    OGRE-草地的制作 OGRE-草地的制作 OGRE-草地的制作 OGRE-草地的制作

    OGRE使用指南v0[1].01a.pdf

    本教程的目的是从使用者的角度将 OGRE 引擎最基本的概念和使用方法做一个较全面 的介绍。本教程隐藏了 OGRE 引擎内部的底层内容,力求做到简单、易懂,是 OGRE 引擎 的入门教程。

    ORGE简体中文基础教程

    ORGE的基础教程,简体中文 非常适合入门的资料

    Ogre_3D_1.7_beginner_Guide中文版

    翻译的还是不错的,中英文对照,初学者可以借着了解下OGER编程

    Ogre_VC9_AppWizard_1.7.1_2

    OGER库自己下载,必须是1.7.1版本 VS为VS2008版本 以上装好之后,然后运行此程序,然后会弹出一个说明文本,如果出现问题就仔细看一下。如果没有问题的话,就打开VS2008,新建工程,在向导中的工程类型选择Visual ...

    toOgerBot:Telegram机器人,用于向Oger进行内联翻译

    安装此程序: :

    跑步者

    跑步者该存储库包含一些附件脚本...nodes.tsv -o termlist.tsv在文档上运行OGER 您可以按以下步骤对文本文档运行OGER, python runner.py run-oger abstract.txt -t termlist.tsv -o out.json -f bioc_json注意:此命令

    HinautDominey2013_PLoS_ONE:有关论文《 Hinaut&Dominey》的源代码,《公共科学杂志》 2013年第1期-one source code

    Hinaut X,Dominey PF(2013)正面-纹波系统中语法结构的实时并行处理:使用储层计算的递归网络模拟研究。 公共科学学报8(2):e52946。 原代码仍然的的。 带有说明的自述文件是。 Python版本和依赖项 此代码...

    OGRE使用指南(入门教程)

    非常全面的OGER使用指南,如果你是新手,这是最好的一本入门教程!99%属于原创!

    CEImagesetEditor-v0.6.2

    非常好用的一个截图编辑器,对于使用OGER开发的人或使用CEGUI的人来说很好用

    Ogre引擎-教程

    本教程由本人自己整理,内容来自网络各个角落。 内部包含7个文档和一个问题 里面有描述游戏大概架构的文档以及OGER引擎的文档

    使用ogre做的练练看游戏

    使用oger做的练练看游戏,里面用到了CEGUI做界面,FMOD播放声音,OIS控制输入,免费给大家分享,有任何问题请邮件: xieaiwanli@hotmail.com

    DevOO-Optimod

    DevOO-Optimod用法从命令行操作系统/Linux # start the app./gradlew run# run the tests./... 然后:文件 &gt; 导入 =&gt; Gradle 项目 执照麻省理工学院许可证 (MIT) 版权所有 (c) 2014 Robin Ricard、Edouard Oger、M

    eoger.me:个人网站

    这是目前托管在上的 Edouard Oger 个人网站的源代码存储库。 主要依赖 Node.js (0.10.x) 快递 (4.9.x) socket.io (1.2.x) React (0.12.x) Browserify (6.3.x) 吞咽(3.8.x) 安装 $ git clone ...

Global site tag (gtag.js) - Google Analytics