walkinglint
2008年06月26日 12:38
//
// File: ColorCycle.lsl
// Date Author number of nodes
// 2008/6/26 walkinglint 19
//
//
// Cycle color each second for every 15 degress around the color wheel
// @author: JB Kraft
// ------------------------------------------------------------------------
// Jan 28, 2007 - v0.1 orig example code
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// 24 color values, one for each 15 degrees around the color wheel
//
// http://wiki.secondlife.com/wiki/Color_Cycle
list realcolors = [
, ,
, ,
, ,
, ,
, ,
, ,
, ,
, ,
, ,
, ,
, ,
];
// keep time
integer g_TIMER = 0;
// the offset into the color array
integer g_NDX = 0;
default {
touch_start(integer total_number) {
// turn the timer on/off
g_TIMER = !g_TIMER;
// cheeky use of flag as timer value
llSetTimerEvent(g_TIMER);
}
timer() {
if (g_NDX > llGetListLength(realcolors) - 1) {
g_NDX = 0;
}
llSetColor(llList2Vector(realcolors, g_NDX), ALL_SIDES);
g_NDX++;
}
}