Time for action — adding a plane and a light

Everything we are going to add this time is going in the createScene() function:

  1. As we already know we need a plane definition, so add one:
    Ogre::Plane plane(Ogre::Vector3::UNIT_Y, -5);
    Ogre::MeshManager::getSingleton().createPlane("plane",
    Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
    1500,1500,200,200,true,1,5,5,Ogre::Vector3::UNIT_Z);
    
  2. Then create an instance of this plane, add it to the scene, and change the material:
    Ogre::Entity* ground= _sceneManager->createEntity("LightPlaneEntity", "plane");
    _sceneManager->getRootSceneNode()->createChildSceneNode()->attachObject(ground);
    ground->setMaterialName("Examples/BeachStones");
    
  3. Also we would like to have some light in the scene; add one ...

Get Ogre 3D 1.7 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.