OGRE 入门 二、Basic Tutorial 1 : An introduction to the most basic Ogre constructs
生活随笔
收集整理的這篇文章主要介紹了
OGRE 入门 二、Basic Tutorial 1 : An introduction to the most basic Ogre constructs
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
1. 下載源代碼及腳本
這里有一個‘Convenient All-In-One’ 版的框架。
?
2. 創(chuàng)建場景
解壓clean_ogre_cmake_project.zip,修改TutorialApplication.cpp中的函數(shù):
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運行效果如圖:
轉載于:https://www.cnblogs.com/invisible/archive/2012/12/03/2800111.html
總結
以上是生活随笔為你收集整理的OGRE 入门 二、Basic Tutorial 1 : An introduction to the most basic Ogre constructs的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 只要1999元的Mini-LED!钛度M
- 下一篇: 1小时基本充满!马斯克:特斯拉或在年底前