blinking 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
eviral
Posts: 91
Joined: Mon Oct 25, 2004 10:25 am

blinking light ???

Post by eviral »

How can i create a slow blinking light to simulate a burning torch in a temple ?

Thanks

Eviral
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

get the light's data like so..
video::SLight *lightdata = light->getLightData();

and change whatever you like at runtime-
http://irrlicht.sourceforge.net/docu/st ... light.html
needforhint
Posts: 322
Joined: Tue Aug 30, 2005 10:34 am
Location: slovakia

Post by needforhint »

but the Slight structure doesnt have such a parameter to use:

Public Attributes
SColorf AmbientColor
Ambient color emitted by the light.

bool CastShadows
Does the light cast shadows?

SColorf DiffuseColor
Diffuse color emitted by the light.

core::vector3df Position
Position of the light.

f32 Radius
Radius of light. Everything within this radius be be lighted.

SColorf SpecularColor
Specular color emitted by the light.

I haven't tried do a blinkin light myself yet, but is the irrlicht anim() function able to animate color of a light? I would just switch it from black to disered one in an interval
what is this thing...
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

mohaps was making a torch animator a while back, you could always pester him for the code :)

http://irrlicht.sourceforge.net/phpBB2/ ... t+animator
AcidFaucet
Posts: 7
Joined: Sun Oct 16, 2005 1:37 am

Post by AcidFaucet »

needforhint wrote:
f32 Radius
Radius of light. Everything within this radius be be lighted.
I'm pretty sure you just covered it right there.

If the light has 0 radius, it's not going to be producing light. If you continually modulate the radius you'll get a pulsing effect of sorts. Combine that with modifications to some of the other settings such as color changes and so on and you shouldn't have a problem producing a torch shimmer effect.

Haven't actually tried doing such, but unless I'm missing some critical detail it works in logic and doesn't clash with the manual.
needforhint
Posts: 322
Joined: Tue Aug 30, 2005 10:34 am
Location: slovakia

Post by needforhint »

that's cool idea, will do :idea:
what is this thing...
Post Reply