Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector red = <1,0,0>;
- vector green = <0,1,0>;
- vector blue = <0,0,1>;
- float rate = 0.05;
- float speed = 0.2;
- integer switch1 = 1;
- integer switch2 = 2;
- integer switch3 = 3;
- integer switch4 = 4;
- integer switch5 = 5;
- integer switch6 = 6;
- integer switch = -1;
- integer currentFade = 1;
- vector ColorCube(vector currColor)
- {
- if (currColor.x < 0)
- currColor.x = 0;
- if (currColor.y < 0)
- currColor.y = 0;
- if (currColor.z < 0)
- currColor.z = 0;
- // From red to yellow
- if ( currentFade == switch1 && currColor.y < 1.0 )
- return (currColor + <0,rate,0>);
- else if( currentFade == switch1 && currColor.y >= 1.0 )
- currentFade = switch2;
- // From yellow to green
- if ( currentFade == switch2 && currColor.x > 0.0 )
- return (currColor - <rate, 0, 0>);
- else if( currentFade == switch2 && currColor.x <= 0.0 )
- currentFade = switch3;
- // From green to blue/green
- if ( currentFade == switch3 && currColor.z < 1.0 )
- return (currColor + <0, 0, rate>);
- else if( currentFade == switch3 && currColor.z >= 1.0 )
- currentFade = switch4;
- // From blue/green to blue
- if ( currentFade == switch4 && currColor.y > 0.0 )
- return (currColor - <0, rate, 0>);
- else if( currentFade == switch4 && currColor.y <= 0.0 )
- {
- currentFade = switch5;
- }
- // From blue to purple
- if ( currentFade == switch5 && currColor.x < 1.0 )
- return (currColor + <rate, 0, 0>);
- else if( currentFade == switch5 && currColor.x >= 1.0)
- currentFade = switch6;
- // From purple to red
- if ( currentFade == switch6 && currColor.z > 0.0 )
- return (currColor - <0, 0, rate>);
- else if( currentFade == switch6 && currColor.z <= 0.0 )
- currentFade = switch1;
- return currColor;
- }
- default
- {
- state_entry()
- {
- llSetTextureAnim(ANIM_ON | LOOP, ALL_SIDES,2,2,0.0,4.0,6.0);
- }
- on_rez( integer param )
- {
- switch = 1;
- llSetColor( <1,0,0> , ALL_SIDES );
- llSetTimerEvent( speed );
- }
- timer()
- {
- vector color = ColorCube(llGetColor(ALL_SIDES));
- llSetColor(color, ALL_SIDES);
- llSetPrimitiveParams([ PRIM_TEXTURE, 2, "d3eebe4a-5933-45dc-b257-957fe8b3db29", <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 0.0 ]);
- llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POINT_LIGHT, TRUE, color, 1.0, 10.0, 0.5]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement