createScene()
, except for the plane-related code.Ogre::Light* light = mSceneMgr->createLight("Light1"); light->setType(Ogre::Light::LT_DIRECTIONAL);
light->setDiffuseColour(Ogre::ColourValue(1.0f,1.0f,1.0f)); light->setDirection(Ogre::Vector3(1,-1,0));
We created a directional light and set it to shine down and rightwards with setDirection(1,-1,0)
. In the previous examples, we always had a rather black plane and a small part of the plane was illuminated by our pointlight or spotlight. Here, we used a directional light and hence the complete plane is illuminated. As said before, a directional light can be thought of as the sun, and the sun doesn't have a falloff radius or anything else. So when it shines, it illuminates everything there is; the same is true for our directional light.
3.19.75.133