We are going to use the code from Chapter 1, Installing Ogre 3D modify it to create a new scene node, and attach it to the scene. We will follow these steps:
In the old version of our code, we had the following two lines in the
createScene()
function:Ogre::Entity* ent = mSceneMgr->createEntity("MyEntity","Sinbad.mesh"); mSceneMgr->getRootSceneNode()->attachObject(ent);
Replace the last line with the following:
Ogre::SceneNode* node = mSceneMgr->createSceneNode("Node1");
Then add the following two lines; the order of those two lines is irrelevant for the resulting scene:
mSceneMgr->getRootSceneNode()->addChild(node); node->attachObject(ent);
Compile and start the application.
You should see the same screen you get when starting the application from Chapter 1.