Page 1 of 1

Poligon count, directional lights

Posted: Tue Oct 31, 2006 11:14 am
by Joe Red
Hi!

I'm new to irrlicht, and I've got to know this two answers to continoue my project.

The first question: How can I create a Directional light? (An example, please!)

How can I get the number of the poligons in a mesh?

Please, reply soon!!

Thanks: Joe Red

Posted: Tue Oct 31, 2006 3:03 pm
by rogerborg
Direction lights are a little "clever". Create a default light, then change its type. Note that the position vector represents where the light is coming from, not the direction of the light ray, so to create a light that that's always (notionally) to the right, above and behind each surface, do:

Code: Select all

core::vector3df sourcePosition(1.f, 2.f, -3.f);
ILightSceneNode light = sceneManager->addLightSceneNode(0, sourcePosition);
video::SLight& lightData = light->getLightData();
lightData.Type = ELT_DIRECTIONAL;
I've suffered a brain failure on the polygon count, I'm afraid. Something something meshbuffer indices divided by three something.

Posted: Tue Oct 31, 2006 4:33 pm
by Joe Red
Thanks for the quick replay! I try it!