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

    运行效果如图:

  • 相关阅读:
    eas之Uuid和BOSUuid 区别
    BOS工具之BOS应用框架
    eas之EAS手工打包及快速部署工具
    S-HR体验中心
    wafII笔记
    eas之MrpUI
    S-HR快速查看shr日志
    S-HR二开基础
    linux安装mysql
    linux安装tomcat
  • 原文地址:https://www.cnblogs.com/invisible/p/2800111.html
Copyright © 2011-2022 走看看