本文介绍了安装Ogre sdk有问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Ogre的新手,试图运行第一个教程,但我遇到一个问题,得到
错误消息

请帮助,它的关键!



另一个问题:



cmake对于安装Ogre sdk ?

解决方案

在linux上使用cmake
获得ogre编译/安装后,

  /usr/local/share/OGRE/resources.cfg 
/usr/local/share/OGRE/plugins.cfg

只要导入到你的ogre项目
一旦ogre安装,你的项目不需要cmake
要让你去参加教程:



如何使用ogre设置eclipse:



>新建 - > C ++项目 - > EmptyProject



C / C ++ Build - >环境
OGRE_LOC / home / scott / src / ogre_src_v1-7-3

C / C ++ Build - >设置

  GCC C ++编译器 - >包括

$ {OGRE_LOC} / OgreMain / include
/ usr / local / include / OGRE
$ {OGRE_LOC} / Samples / Common / include
/ usr / include / OIS

GCC C ++ Linker - >库(-l)

OgreMain
OgreTerrain
OIS
CEGUIOgreRenderer

右键单击项目 - >属性 - >导入

 常规 - 文件系统 - > 

只从教程项目中导入这4个文件
(NOT dist,build,makefiles ...)

BaseApplication.cpp
BaseApplication.h
TutorialApplication.cpp
TutorialApplication.h

也可以导入以下文件:

/usr/local/share/OGRE/resources.cfg
/usr/local/share/OGRE/plugins.cfg

现在您可以编译和运行!



要添加Ogre模型:



首先执行上述步骤创建一个ogre项目,好。在执行它会渲染一个黑色的屏幕 - 这很好。现在添加模型(Ogre)只需编辑TutorialApplication.cpp,函数createScene就会显示为:



``



void TutorialApplication :: createScene(void)
{

  Ogre :: Entity * ogreHead = mSceneMgr-> createEntity(Head,ogrehead.mesh); 

Ogre :: SceneNode * headNode = mSceneMgr-> getRootSceneNode() - > createChildSceneNode();
headNode-> attachObject(ogreHead);

//设置环境光
mSceneMgr-> setAmbientLight(Ogre :: ColourValue(0.5,0.5,0.5));

//创建一个光
Ogre :: Light * l = mSceneMgr-> createLight(MainLight);
1-> setPosition(20,80,50);

}


I'm new to Ogre and tried to run the first tutorial, but I have faced a problem getting theerror message

Please help, its critical!

Another question:

Is cmake important for installing the Ogre sdk?

解决方案

After getting ogre compiled/installed using cmakeon linux those two config files live at

/usr/local/share/OGRE/resources.cfg
/usr/local/share/OGRE/plugins.cfg

just import both into your ogre projectOnce ogre is installed, your project does not need cmakeTo get you going for the tutorials :

How to setup eclipse with ogre :

File -> New -> C++ Project -> EmptyProject

C/C++ Build -> Environment OGRE_LOC /home/scott/src/ogre_src_v1-7-3

C/C++ Build -> Settings

GCC C++ Compiler -> Includes

    ${OGRE_LOC}/OgreMain/include
    /usr/local/include/OGRE
    ${OGRE_LOC}/Samples/Common/include
    /usr/include/OIS

GCC C++ Linker -> Libraries (-l)

    OgreMain
    OgreTerrain
    OIS
    CEGUIOgreRenderer

right click project -> Properties -> Import

General -> File System -> 

    ONLY import those 4 files from the tutorial project 
           (NOT dist, build, makefiles ...)

        BaseApplication.cpp
        BaseApplication.h
        TutorialApplication.cpp
        TutorialApplication.h

    also import these files :

/usr/local/share/OGRE/resources.cfg
/usr/local/share/OGRE/plugins.cfg

Now you are ready to compile and run !

To add an Ogre model :

First do above steps to create an ogre project, assure it compiles OK. On execution it'll render a black screen - thats fine. Now to add a model (an Ogre) simply edit TutorialApplication.cpp so function createScene appears as :

``

void TutorialApplication::createScene(void){

Ogre::Entity* ogreHead = mSceneMgr->createEntity("Head", "ogrehead.mesh");

Ogre::SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
headNode->attachObject(ogreHead);

// Set ambient light
mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5, 0.5, 0.5));

// Create a light
Ogre::Light* l = mSceneMgr->createLight("MainLight");
l->setPosition(20,80,50);

}

这篇关于安装Ogre sdk有问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 20:55