Found it!

Yesterday, I was probing for 2D implementation along with 3D in Ogre. And I was in the vicinity of overlays, manual objects and so many other things. But was this required yet? No. Chase two rabbits and both will escape!
Got a better clear insight today on how to take the next steps. So I started looking for what basic primitives are facilitated by Ogre. What operations could be performed on the various primtives, that were provided by Ogre? Simultaneously, I implemented point on Qt’s scene, though was not a priority, but that segmentation fault had tested much of my patience and it was done! Also, I just worked out on adding a predefined(or static) point and line to Ogre’s scene. Was not tough though and no mouse clicks yet.
Ha! Then finally I greeted Ogre Procedural Geometry Library. This library provides basic primitives like box, sphere, torus, cylinder, cone, circle, ellipse, spline, bezier curve and yet a few more. It also supports 2D transformations namely rotation, scaling, translation and also equips operations like union, intersection, extrusion.

  • Clone it from bitbucket using- hg clone ogre-procedural To clone from bitbucket, you must install mercurial using – sudo apt-get install mercurial
  • I used cmake-gui for building it. Choose source and build directories.
  • Click on ‘Add Entry’ and set a variable ‘OGRE_HOME’ with its ‘PATH’ referring to your Ogre source directory
  • Hit ‘Configure’ and then ‘Generate’. You are done.

By this moment, I have just added a sphere using it in my scene. No material is associated with it yet. To be able to perform operations is significant. Continuing the same.

A New Turn

After yesterday’s presentation concerning the GUI, making eCAD productive to the user, considering 3D too, we landed up to the conclusion that we will be using Ogre3D and various libraries of BRL-CAD like libbn(maths), libbu(utility), librt(ray-tracing).

Oops! It happens. I was compiling OGRE from my own blog but it did not work. All the dependencies were installed on my system. What was it? Cmake could not find where the libfreetype6 library was installed. Endeavored till I was done with installation.

What did I do? I installed the dependencies in a separate folder. Ahan! bitbucket has a repository of Ogre dependencies. The zip file can be downloaded from here: ogredeps.

Then follow these steps:

  1. Extract it.
  2. cd/path_to_directory_where_you_extracted
  3. mkdir build
  4. cd build
  5. cmake ..
  6. make
  7. make install

You are done with dependencies. After this you will have a directory named ogredeps in your build directory. This has include and lib folders in it. Then I installed cmake-gui using sudo apt-get install cmake-qt-gui in order to be specific in providing paths manually.

Provide the path to your Ogre source, Ogre build directory and the dependencies directory i.e. the ogredeps you got after compiling dependencies.

Click Configure and then Generate. Phew! Worked. Now we will be implementing a cylinder in OGRE’s scene along with Qt. Till now nothing has been taken into account of 3D. But from now on, it will be done too as a priority so that no major changes have to be done in future.

Compiling OGRE app in QtCreator

OGRE applications can be built in various IDEs. I went on with my friend these days- QtCreator. In order to be able to see OGRE working on my system, I made an application with pre-constructed code. You can follow the instructions below:

  1. Just download the file at this link and un-tar it. This download contains a tutorial, a dist directory and a cmake script.
  2. Put the files in a directory, say ogre-demo.
  3. Now open QtCreator and open the CMakeLists.txt file here.
  4. A dialog box will ask you to choose a build directory. By default, a new build directory is created. Just click next.
  5. Now, you will be asked to run cmake. Click the “Run Cmake” button.
  6. After this, open terminal and move to the build directory.
  7. Run make && make install there. If you do not run these, the console below in QtCreator would display an exit message.
  8. Now, you can run the app in QtCreator. You will be having a blank black screen in front of you just like the one below, though the app has compiled and is running decently.


Time to add something to see OGRE in action. 😀 I told about tutorial framework in the download done in step 1. Remember? Hm! Counting on the files in it, the entity that would be displayed in the OGRE window on running the app is defined in the file TutorialApplication.cpp. Open the file and you will find the function createScene() is empty.

Make your function look like:

void TutorialApplication::createScene(void)
// Set the scene's ambient light
mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5f, 0.5f, 0.5f));

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

    // Create a SceneNode and attach the Entity to it
    Ogre::SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("HeadNode");

    // Create a Light and set its position
    Ogre::Light* light = mSceneMgr->createLight("MainLight");
    light->setPosition(20.0f, 80.0f, 50.0f);


Scrutinizing the code above, you will find entity Head whose source file is ogrehead.mesh. This file is present in the dist folder we got during the download, more specifically in dist/media/models folder.

Save your file and run the app. And you get this output:


Once the program is working, use the WASD keys to move, and the mouse to look around. The Escape key exits the program.

You got a basic OGRE app working with QtCreator on your system.

Well, I did not go with literal meaning of OGRE this time. 😛 You know what it is? The word "ogre" is of French origin and is used to depict a large, hideous, manlike monster that eats human beings. Ogres frequently feature in mythology, folklore, and fiction throughout the world. The above output illustrates it well! 😀

The Introductory Stride to OGRE

OGRE, acronym for Object-oriented Graphics Rendering Engine, is a scene-oriented 3D engine to make applications that make use of hardware-accelerated 3D graphics. The engine is written using C++. OGRE can be used in games, simulations.

OGRE has an object-oriented design with a plugin architecture that allows easy addition of features, thus making it highly modular. The engine is flexible, in the sense that there are no predefined constraints on those who wish to want to use OGRE, unlike other engines that are designed for a particular type of game or some application. Considering the gaming industry only, the developers can make use of different libraries in integration to OGRE, depending on their requirements.

OGRE provides support for various platforms including Linux, Windows, iOS and Android. It also imparts bracing for materials, shaders, meshes, animations. Special effects supported include compositor systems, particle systems, sprite graphics and much more. It has been used in commercial games like Torchlight and Ankh.

Installing OGRE: