This time, we want to use the OctreeSceneManager
, so we don't need the chooseSceneManager()
function:
We need an empty application:
class Example43 : public ExampleApplication { private: public: void createScene() { } };
The first thing we need in the
createScene()
function is a plane definition. We will use the plane as our ground for blades of grass: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);
Then instantiate the newly created plane and set a material. We will use the
GrassFloor
material from the examples:Ogre::Entity* ent = mSceneMgr->createEntity("GrassPlane", "plane"); mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent); ent->setMaterialName("Examples/GrassFloor");
Then also add a directional light to the scene; otherwise, it would...