Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Gradient colors on prims

MeLight Korvin
Im on da Use
Join date: 4 Jun 2005
Posts: 99
03-09-2006 12:37
Yay! Was easier than i thought actually, what it does is takes two RGB values u give it in chat and grades all colors between them on the prim that are in it's linkset (by the linking order of course) Try it, it's fun


CODE

//Das MeLight Korvin's work
//Use freely and mod and whatever but don't be a schmuck and sell it as is
//How to use:
//1. Put this script in an object of at least 2 prims (the more the better, the grading will be smoother)
//2. now you have to command it to grade between any two RGB's, RGB's entered as floats (0-1 scale) lets say u wanna grade from red to blue
//the command will look like this: /12 grade 1 0 0 0 0 1
//first 3 values first RGB, and the ending 3 are of the second RGB (duh)
//if you having problemos lemmie know

list colCom;
default
{
state_entry()
{
llListen(12, "", "", "");
}

listen(integer channel, string name, key id, string message)
{
//if(id != llGetOwner()) return; //remove the first '//' to make it work for owner only

colCom = llParseString2List(message, [" "], []);
if(llList2String(colCom,0) == "grade")
{
vector startCol = <llList2Float(colCom,1), llList2Float(colCom,2), llList2Float(colCom,3)>;
vector endCol = <llList2Float(colCom,4), llList2Float(colCom,5), llList2Float(colCom,6)>;
vector grades = <(endCol.x - startCol.x)/llGetNumberOfPrims(), (endCol.y - startCol.y)/llGetNumberOfPrims(), (endCol.z - startCol.z)/llGetNumberOfPrims()>;

integer x;
for(x = 1; x < llGetNumberOfPrims()+ 1; x++)
{
startCol += grades;
llSetLinkColor(x, startCol, ALL_SIDES);
}
}
}

touch_start(integer total_number)
{

}
}

_____________________
Boobs are remote controls for the male brain. Lemmie push some buttons!!!
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Original Thread
03-09-2006 20:49
/15/1d/92561/1.html
_____________________
i've got nothing. ;)