Poligon count, directional lights

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Joe Red
Posts: 9
Joined: Tue Oct 31, 2006 11:10 am

Poligon count, directional lights

Post 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
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post 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.
Joe Red
Posts: 9
Joined: Tue Oct 31, 2006 11:10 am

Post by Joe Red »

Thanks for the quick replay! I try it!
Post Reply