Once again, we start with the same code block we used before.
Remove all the code from the
createScene()
function and insert the following code block:Ogre::Entity* ent = mSceneMgr->createEntity("MyEntity","Sinbad.mesh"); Ogre::SceneNode* node = mSceneMgr->createSceneNode("Node1"); node->setPosition(10,10,0); mSceneMgr->getRootSceneNode()->addChild(node); node->attachObject(ent);
Again, create a new entity:
Ogre::Entity* ent2 = mSceneMgr->createEntity("MyEntity2","Sinbad.mesh");
Now we use a function that creates the scene node and adds it automatically as a child. Then we do the same thing we did before:
Ogre::SceneNode* node2 = node->createChildSceneNode("node2"); node2->setPosition(10,0,0); node2->attachObject(ent2);
Now, after the
setPosition()
function, call the following line to scale the model:node2->scale(2.0f,2.0f,2.0f);
Create a new entity:
Ogre::Entity* ent3 = mSceneMgr->createEntity("MyEntity3","Sinbad.mesh...