i added a directional light to 'simulate' the sun but it look like the lighting on my planet orbiting the sun come from a totally different position:
As you see in the last screenshot it seem it don't come from the sun in the background but from another light source (there is only one light tho).
Here is a better shot:
The light is added like that:
Code: Select all
sun = smgr->addLightSceneNode(0, core::vector3df(0.0f,0.0f,0.0f),
video::SColor(0,200, 200, 200), 5000.0f);
sun->setLightType(video::ELT_DIRECTIONAL);
sun->enableCastShadow(true);
Code: Select all
planetMesh = smgr->addSphereMesh("Sphere", 1.0f, 64, 64);
planetMesh->setHardwareMappingHint(scene::EHM_STATIC);
Code: Select all
planet = smgr->addAnimatedMeshSceneNode(planetMesh, orbitNode, -1, core::vector3df(0, 0, 0),
core::vector3df(0, 0, 0), core::vector3df(2000, 2000, 2000);
for(unsigned int i=0;i<planet->getMaterialCount();i++)
{
video::SMaterial &matPlanet = planet->getMaterial(i);
matPlanet.AmbientColor = video::SColor(255,255,255,255);
matPlanet.DiffuseColor = video::SColor(255,0,0,0);
matPlanet.EmissiveColor = video::SColor(255,1,1,1);
matPlanet.SpecularColor = video::SColor(128,66,66,66);
matPlanet.MaterialTypeParam = 0.0035f;
matPlanet.Shininess = 14.0f;
matPlanet.Lighting = true;
matPlanet.NormalizeNormals = true;
}