Welcome to Sophia's Design Blog Page
// For Keystone Bouchard. http://www.archsl.wordpress.com for an installation on Architecture Island, September 2007. Scripted by Fumon Kubo//Shared under Creative Commons Attribution-Share Alike 3.0 Licensevector NEAR_COL = <1.0, 0.0, 0.0>;vector FAR_COL = <1.0, 1.0, 1.0>;vector NEAR_SIZE = <0.5, 0.22, 1.0>;vector FAR_SIZE = <0.5, 0.22, 4.004>;float NEAR = 1.0;float FAR = 5.0;default{ state_entry() { llSay(0, "Hello, Avatar!"); llSensorRepeat("", NULL_KEY, AGENT, FAR, PI, 0.2); } sensor(integer total_number) { float distance = llVecMag(llDetectedPos(0) - llGetPos()); float scale = (distance - NEAR) / (FAR - NEAR); if (scale < 0.0) scale = 0.0; llSetScale(NEAR_SIZE + ((FAR_SIZE - NEAR_SIZE) * scale)); llSetColor(NEAR_COL + ((FAR_COL - NEAR_COL) * scale), ALL_SIDES); }}
// For Keystone Bouchard. http://www.archsl.wordpress.com for an installation on Architecture Island, September 2007. Scripted by Fumon Kubo
ReplyDelete//Shared under Creative Commons Attribution-Share Alike 3.0 License
vector NEAR_COL = <1.0, 0.0, 0.0>;
vector FAR_COL = <1.0, 1.0, 1.0>;
vector NEAR_SIZE = <0.5, 0.22, 1.0>;
vector FAR_SIZE = <0.5, 0.22, 4.004>;
float NEAR = 1.0;
float FAR = 5.0;
default
{
state_entry()
{
llSay(0, "Hello, Avatar!");
llSensorRepeat("", NULL_KEY, AGENT, FAR, PI, 0.2);
}
sensor(integer total_number)
{
float distance = llVecMag(llDetectedPos(0) - llGetPos());
float scale = (distance - NEAR) / (FAR - NEAR);
if (scale < 0.0) scale = 0.0;
llSetScale(NEAR_SIZE + ((FAR_SIZE - NEAR_SIZE) * scale));
llSetColor(NEAR_COL + ((FAR_COL - NEAR_COL) * scale), ALL_SIDES);
}
}