zoukankan      html  css  js  c++  java
  • OGRE 入门 二、Basic Tutorial 1 : An introduction to the most basic Ogre constructs

    1. 下载源代码及脚本

    这里有一个‘Convenient All-In-One’ 版的框架。

    2. 创建场景

    解压clean_ogre_cmake_project.zip,修改TutorialApplication.cpp中的函数:

     1 void TutorialApplication::createScene(void)
     2 {
     3     // create your scene here :)
     4     mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5f,0.5f,0.5f));
     5 
     6     // Create an entity
     7     Ogre::Entity* ogreHead=mSceneMgr->createEntity("Head","ogrehead.mesh");
     8 
     9     //create a sceneNode and attach the Entity to it
    10     Ogre::SceneNode* headNode=mSceneMgr->getRootSceneNode()->createChildSceneNode("HeadNode");
    11     headNode->attachObject(ogreHead);
    12 
    13 
    14     //create a light and set its position
    15     Ogre::Light* light=mSceneMgr->createLight("MainLight");
    16     light->setPosition(20.0f,80.0f,50.0f);
    17 }

    3. 编译、安装、运行

    cmake CMakeLists.txt
    make install
    dist/bin/OgreApp

    运行效果如图:

  • 相关阅读:
    C#:反射
    静态和非静态类
    数据的存入取出(注册机方式)
    退出unity运行
    网络流基础
    欧拉回路
    博弈论问题
    洛谷P5304 [GXOI/GZOI2019] 旅行者
    [ZJOI2006]物流运输
    POJ3278 Catch that cow
  • 原文地址:https://www.cnblogs.com/invisible/p/2800111.html
Copyright © 2011-2022 走看看