This time, we are going to rotate using different spaces, as follows:
And again, we will start with a clean
createScene()
function, so delete all code inside this function.Add the reference model:
Ogre::Entity* ent = mSceneMgr->createEntity("MyEntity","sinbad.mesh"); Ogre::SceneNode* node = mSceneMgr->createSceneNode("Node1"); mSceneMgr->getRootSceneNode()->addChild(node); node->attachObject(ent);
Add a second model and rotate it the normal way:
Ogre::Entity* ent2 = mSceneMgr->createEntity("MyEntity2","sinbad.mesh"); Ogre::SceneNode* node2 = mSceneMgr->getRootSceneNode()->createChildSceneNode("Node2"); node2->setPosition(10,0,0); node2->yaw(Ogre::Degree(90)); node2->roll(Ogre::Degree(90)); node2->attachObject(ent2);
Add a third model using world space:
Ogre::Entity* ent3 = mSceneMgr->createEntity("MyEntity3","Sinbad.mesh"); Ogre::SceneNode* node3 = node->createChildSceneNode("node3"); node3->setPosition...