We will use a slightly different version of the scene from the previous chapter:
Delete all code in the
createScene()
and thecreateCamera()
functions.Delete the
createViewports()
function.Add a new member variable to the class. This member variable is a pointer to a scene node:
private: Ogre::SceneNode* _SinbadNode;
Create a plane and add it to the scene using the
createScene()
method:Ogre::Plane plane(Vector3::UNIT_Y, -10); Ogre::MeshManager::getSingleton().createPlane("plane", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane, 1500,1500,200,200,true,1,5,5,Vector3::UNIT_Z); Ogre::Entity* ent = mSceneMgr->createEntity("LightPlaneEntity", "plane"); mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent); ent->setMaterialName("Examples/BeachStones");
Then add a light to the scene:
Ogre::Light* light = mSceneMgr->createLight("Light1"); light->setType(Ogre::Light::LT_DIRECTIONAL); light->setDirection(Ogre::Vector3...