Demo for 'Getting Started With Blender and Ogre'

In this first demo we are going to go through the process of making a basic Blender model and exporting it for use in a demo Ogre3D program.

To get started you are going to want to get your own copy of HelloOgre from /cs/dept/www/course_archive/2009-10/F/4471/src

Then make sure you can compile the code (and run it) by going into your own HelloOgre directory and attempting the commands:

make -f Makefile

Next, try your hands at some basic 3D modeling. Open up blender (Type "blender" in the console) and follow the tutorial here to create a simple model. When you are done, save the blender file and export the file for use with Ogre. This can be done in Blender from the File menu (File>Export>Ogre Meshes). This should generate a yourModel.mesh.xml and a Scene.material file in the same directory as your blender model. When you are done this, there is one last processing step required and that is to convert the .mesh.xml file into a .mesh file that can be used directly in the Ogre graphics engine. To do this use the following commands:

export LD_LIBRARY_PATH=/cs/local/bin/:/cs/local/packages/cg-2.2/lib/
OgreXMLConverter yourModel.mesh.xml

The next step is to take the .mesh file that was created and copy it into your HelloOgre/Media/models folder and the Scene.material file into HelloOgre/Media/materials/scripts. The last thing that needs to be modified is the file HelloOgreApplication.cpp.

// Also add an object
Entity *ent = mSceneMgr->createEntity( "ogre", "ogrehead.mesh" );
ogreNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
ogreNode->setPosition(0, 0, 0);

On line 236 the entity for the floating ogre head is defined. For now, change the part that says ogrehead.mesh with yourModel.mesh, save the source, recompile and run. The floating Ogre head should now be replaced with your newly created model.