We will use the previous code, but create completely new code for the createScene()
function.
First create an instance of
Sinbad.mesh
and then create a new scene node. Set the position of the scene node to (10,10,0), at the end attach the entity to the node, and add the node to the root scene node as a child: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 instance of the model, also a new scene node, and set the position to (10,0,0):
Ogre::Entity* ent2 = mSceneMgr->createEntity("MyEntity2","Sinbad.mesh"); Ogre::SceneNode* node2 = mSceneMgr->createSceneNode("Node2"); node->addChild(node2); node2->setPosition(10,0,0);
Now add the following two lines to rotate the model and...