Page 1 of 1

Directional Lights problem?

Posted: Sun Jul 29, 2007 5:50 pm
by cfoks
How can I use directioal lights on irrlicht or are there directional lights?
I look at the forums but I can't get any good solution....

Posted: Sun Jul 29, 2007 5:57 pm
by arras

Code: Select all

scene::ILightSceneNode* light = smgr->addLightSceneNode(0, core::vector3df(0,0,0), video::SColorf(255, 255, 255, 255), 1000.0f);
video::SLight ldata = light->getLightData();
ldata.Type = video::ELT_DIRECTIONAL;
ldata.Position = core::vector3df(-10,5,-5);
light->setLightData(ldata);

Posted: Sun Jul 29, 2007 6:53 pm
by cfoks
I try but I cannot see anything. hmmmmm. thinking......

Posted: Sun Jul 29, 2007 8:50 pm
by arras
is lighting material flag of your scene nodes turned to true?

Posted: Mon Jul 30, 2007 4:50 pm
by cfoks
hmmm...I enabled it to true but I got debug error....I disabled it to false and I closed the all lights and I got different result but it is not directional light because it lights all the face of objects in current scene...I think irrlicht does not have directional light like cone ...

[/img]

Posted: Mon Jul 30, 2007 5:17 pm
by hybrid
You mean spot light, not directional light. Directional light is like sunlight from a light source infinitely far away. And no, no spot lights yet.

Posted: Mon Jul 30, 2007 5:27 pm
by cfoks
hmmm....OK. Then,I will try to find different solution to get spot light... continue to thinking.......