
上QQ阅读APP看书,第一时间看更新
We are using the previously suggested code to find out what is missing in our scene.
- After the creation of the light, add code to create an instance of Sinbad.mesh and also create a node and attach the model to it:
Ogre::Entity* Sinbad = mSceneMgr->createEntity("Sinbad", "Sinbad.mesh"); Ogre::SceneNode* SinbadNode = node->createChildSceneNode("SinbadNode");
- Then scale Sinbad to three times his size and move him a bit upwards; otherwise, he will be stuck in the plane. Also add him to the scene node, so he will be rendered:
SinbadNode->setScale(3.0f,3.0f,3.0f); SinbadNode->setPosition(Ogre::Vector3(0.0f,4.0f,0.0f)); SinbadNode->attachObject(Sinbad);
- Compile and run the application.