How can I add a parallel light?

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
sunzhuo
Posts: 17
Joined: Tue Dec 23, 2008 2:14 am
Location: Nagoya

How can I add a parallel light?

Post by sunzhuo »

I found there is a type of light scenenode which can be used as a dynamic point light. But I want add a parallel light that is emitted from infinity. How can I do that?
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Change the light type to directional. To do this, you may find the documentation to be useful. Once you have the right light type, you need to be able to control the direction. To figure out how this works, you will want to look at the source. The code that calculates the direction of the light is in doLightRecalc().

Travis
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The API docs also describe the basic idea (light shines into direction (0,0,1) and can be rotated using the usual scene node methods).
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

But how should I do that? I was going to use my keyboard for typing, and my monitor to view the results, but I thought I should check first. :P
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

You're hilarious.
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

sunzhuo looks like a bored spammer. nothing to do except ask silly questions, before the next batch spams are released.
Image
sunzhuo
Posts: 17
Joined: Tue Dec 23, 2008 2:14 am
Location: Nagoya

Post by sunzhuo »

sorry, guys. I am not tending to bother you. But it is really difficult for a 3d beginners to precisely manipulate irrlicht. It will take you just a minute but few hours of me to solve a problem. I just want to integrate irrlicht into my spatial analysis framework MicroCity.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

To be honest, we still have no good tutorial for lights in Irrlicht, hence the usage might be not too obvious in the beginning. However, going through the API docs should lead to to the existing methods and members which might be of interest. So just put the code together in a way you'd expect it to work. If it fails show us the code and we'll help you without so many complaints :D
Post Reply