Color Sides.  Colors each side of an object a different color.    
float loclip (float num, float clipat )
{ num = num + .5- clipat ;
float Result = num * llRound (num);
return Result; }
User defined function
num is number (usually random) between 0 and 1; clipat is clip point. Numbers less than clipat are set to zero.
float randFMTO(float FM, float TO)
{ return llFrand(TO- FM) + FM; }
User defined function  Result is random number ranging  from FM to TO.
integer TotSides; Global variables
default {
   state_entry()
 

 { llSetTimerEvent(20.0) ;
TotSides = llGetNumberOfSides(); }

 

 timer()
{ integer i;
for (i = 0; i < TotSides ; i++)
{float red = randFMTO(.2, 1.); //for block
float green = loclip((llFrand (1)),.6);
float blue= loclip((llFrand (1)),.4) ;
llSetColor(<(float)red,(float)green,(float)blue >, i);}// end for block

Iteration over sides.  Side numbering starts at zero
      }
}
Close timer block
Close default
The Thinkerer 05/08/2008
Copyright (c) D. F. Dansereau & S. H. Evans

Site Map

Where start?

LODScr
Famous fables