|
lumina Litvak
Registered User
Join date: 15 Jan 2007
Posts: 11
|
03-24-2008 22:39
I want to change the color of a light gradually . I thought I could increase the Red_Light variable and decrease Blue_Light for example in this statement to have a light change from Blue to Red (assuming Red_Light starts at 0.0 and Blue_Light at 1.0. If I put this in a timer event and increment Red_Light every .1 seconds it doesn't work or sometimes it works but misses some of the increments/decrements. llSetPrimitiveParams([PRIM_POINT_LIGHT,TRUE, <Red_Light,0,Blue_Light>, 1.0, 10.0, 0.6 ]);
If I set the timer event to 1 second it works but choppy . I wanted a gradual change. Is it just because lights are computationally difficult. If I just change the color of an object with llSetColor I get a nice smooth change. Is there a way to do what I want to do with lights?
|
|
Ollj Oh
Registered User
Join date: 28 Aug 2007
Posts: 522
|
03-25-2008 00:52
// llSetPrimitiveParams has a delay of +0.2 seconds. its just slower. // llSetColor has a delay of +ZERO seconds. // timers are affected by time dilation, so they may just go 50% slower at random. //try to multiply the timer-delay by (timer*llGetTimeDilation()) after every change, to calculate out some time dilation changes.
// to set light and color in ONE llSetPrimitiveParams() with just 0.2 sec delay: llSetPrimitiveParams([ PRIM_POINT_LIGHT, integer boolean, vector color, float intensity, float radius, float falloff , PRIM_COLOR, integer face, vector color, float alpha ]);
// soon vertex shaded glow will be scriptable via: llSetPrimitiveParams([ PRIM_GLOW, integer face , float intensity ]};
//Glow is multiplied with the textures alpha channel, this makes some nice blinking lights by animating a glowing alpha gardient texture.
|
|
lumina Litvak
Registered User
Join date: 15 Jan 2007
Posts: 11
|
03-25-2008 13:25
Thanks Ollj, I didn't realize there was .2 second delay constraint, on llSetPrimitiveParams although even at .2 seconds it didn't work. I will try the time dilation trick
// timers are affected by time dilation, so they may just go 50% slower at random. //try to multiply the timer-delay by (timer*llGetTimeDilation()) after every change, to calculate out some time dilation changes.
Although time dilation doesn't seem to be an issue with llSetColor . Thanks Again .
|