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
CMake is critical for building the ogre sdk from source - I would not try to configure the installation yourself. If you are using the prebuilt sdk, cmake is probably unnecessary.
As far as your error goes, it happens to be that you are trying to load resources from the resources.cfg
. I am unaware of your operating system, however, be sure that your resources.cfg is in the same directory as your binary. If you are using MSVC and running it through the debugger, make sure your working directory (found in Project Properties -> Debugging -> Working Directory) is set to the directory of your executable.
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);
}