I am trying to load a mesh object (so an obj file) into irrlicht.
When i load for example a cylinder, i cannot view different color for the faces.
All faces have the same gray, whatever i am doing, like moving the light, etc.
I have this :
when i want something like that :
here is my code :
Code: Select all
scene::ILightSceneNode* light1 = 0;
light1 = SceneManager->addLightSceneNode();
video::SLight lightdatas;
lightdatas.Position = core::vector3df(0, 0, 0);
lightdatas.Type = video::ELT_POINT;
lightdatas.Radius=2.0f;
lightdatas.AmbientColor = video::SColorf(0.3f,0.3f,0.3f,0.5f);
lightdatas.SpecularColor= video::SColorf(0.4f,0.0f,0.0f,1);
lightdatas.DiffuseColor = video::SColorf(1.0f,1.0f,1.0f,0.6f);
lightdatas.CastShadows = false;
light1->setLightData(lightdatas);
Code: Select all
iscenenode= t_pSceneMngr->addAnimatedMeshSceneNode(MyObject);
iscenenode->setMaterialType(video::EMT_LIGHTMAP_LIGHTING);
iscenenode->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);
iscenenode->getMaterial(0).AmbientColor.set(255,255,255,255);
iscenenode->getMaterial(0).SpecularColor.set(255,255,255,255);