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
Poligon count, directional lights
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
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:
I've suffered a brain failure on the polygon count, I'm afraid. Something something meshbuffer indices divided by three something.
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;