I loaded a room of .my3d format and try to light the room with a lighting node, but it seems that only the floor is lightened, the wall is all black.
I have adjusted the radius of the light and it doesn't work.
the code relevent is as follow
Code: Select all
//code for a room
scene::IAnimatedMesh *house_mesh;
house_mesh=smgr->getMesh("Data/media/may20/room2/room17.MY3D");
scene::IAnimatedMeshSceneNode* house_node=smgr->addAnimatedMeshSceneNode (house_mesh);
house_node->setPosition (core::vector3df (0,-40,0));
house_node->setMaterialFlag(video::EMF_LIGHTING, true);
//add a light
scene::ISceneNode* light_node1 = smgr->addLightSceneNode( 0,core::vector3df(20.0,20.0,30.0), video::SColorf(1.0f,0.9f,0.80f,1.0f), 8000.0f);
// scene::ISceneNode* light_node2 = smgr->addLightSceneNode( 0,core::vector3df(0.0,400.0,0.0), video::SColorf(1.0f,1.0f,1.0f,1.0f), 1000.0f);
// scene::ISceneNode* light_node3 = smgr->addLightSceneNode( 0,core::vector3df(0.0,-400.0,0.0), video::SColorf(1.0f,1.0f,1.0f,1.0f), 1000.0f);
scene::ISceneNodeAnimator* sphere_node_light = smgr->createFlyCircleAnimator(core::vector3df(67,50,0),0.0f);
light_node1->addAnimator(sphere_node_light);
sphere_node_light->drop();
//attach billboard to light
light_node1 = smgr->addBillboardSceneNode(light_node1,core::dimension2d<f32>(50,50));
light_node1->setMaterialFlag(video::EMF_LIGHTING, false);
light_node1->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
light_node1->setMaterialTexture(0, driver->getTexture("Data/media/particlewhite.bmp"));
what is quite odd is that if I put other two light node below and above the house(light node 2 and 3 ), the wall will be lighted....and also, the model got three shadows...
pic:
and one could help??? really thanks a lot... [/b]