Page 1 of 1

Flashlight

Posted: Fri Apr 20, 2012 4:08 pm
by Andy54
Hi, I'm trying to add a flashlight light to my scene and Ive searched these forums and found this code from another post.

Code: Select all

ILightSceneNode* flashlight = smgr->addLightSceneNode();
                SLight flashlightData;
                flashlightData.Direction= camera[0]->getRotation();
                flashlightData.OuterCone= 20;
                flashlightData.Position= camera[0]->getPosition();
                flashlightData.Falloff= 30;
                flashlightData.Type= ELT_SPOT;
                flashlight->setLightData(flashlightData);
                flashlight->setRadius(100);
                flashlight->setParent(camera[0]);


However nothing shows up and was seeing if anyone would be able to help me as the post I got this from went no further after the code was posted.

Thanks

Re: Flashlight

Posted: Fri Apr 20, 2012 7:24 pm
by ACE247
Have you set the materials of the meshes in your scene to receive light?

Re: Flashlight

Posted: Sun Jun 05, 2022 5:36 pm
by netpipe
i tried with mine too
viewtopic.php?p=306627#p306627