Problem with installing Ogre sdk?

前端 未结 2 2013
不思量自难忘°
不思量自难忘° 2021-02-10 22:35

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

OGRE EXCEPTION(6:FileNotFoundException): \'res

2条回答
  •  不要未来只要你来
    2021-02-10 23:04

    After getting ogre compiled/installed using cmake on 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 project Once ogre is installed, your project does not need cmake To 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);
    

    }

提交回复
热议问题