Jym_Nova icon

Rez and Wrap in a circle

Jym_Nova | PRO | 06/16/15 07:00:04 PM UTC | 0 ⭐ | 900 👁️ | Never ⏰ | []
Linden Scripting |

0 B

|

None

|

0 👍

/

0 👎

// Written By: Ĵyм Ѡҩℓƒ (Jym Resident)
/* 
LICENCE:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
or you may visit - http://license.idjhost.com/
*/
// DESCRIPTION
// Rez items in a circle around the root prim
 
string objectName = "Object";
integer rezTen = 10;
float xRadius = 0.64;
float yRadius = 0.64;
float flareAngle = 0.0;
float bendCoefficient = 0.0;
vector rotOffset = <0.0, 180.0, 0.0>;
vector posOffset = <0.0, 0.0, 1.0>;
 
makeTen(){
    integer n;
    float theta;
    vector pos;
    rotation rot;
 
    for(n = 0; n < rezTen; n++) {
        theta = TWO_PI * ( (float)n / (float)rezTen );
 
        pos.x = xRadius * llCos(theta);
        pos.y = yRadius * llSin(theta);
        pos.z = -bendCoefficient*llCos(theta)*llCos(theta);
        pos = pos + llGetPos() + posOffset;
 
        rot = llEuler2Rot(<rotOffset.x*DEG_TO_RAD, rotOffset.y*DEG_TO_RAD, rotOffset.z*DEG_TO_RAD>);
        rot = rot * llEuler2Rot(<0, -1*flareAngle*DEG_TO_RAD, 0>);
        rot = rot * llRotBetween(<0.0,1.0,0.0>, <-1.0 * xRadius * llSin(theta) / ( llSqrt ( (yRadius*yRadius * llCos(theta) * llCos(theta)) + (xRadius*xRadius * llSin(theta) * llSin(theta))) ),yRadius * llCos(theta) / ( llSqrt ( (yRadius*yRadius * llCos(theta) * llCos(theta)) + (xRadius*xRadius * llSin(theta) * llSin(theta))) ),0.0>);
        if ( n== (rezTen/2) )
        rot = rot * llEuler2Rot( <0,PI,0> );
 
        llRezObject(objectName, pos, ZERO_VECTOR, rot, 0);
    }
}
 
default{
    on_rez(integer r){
        llResetScript();
    }
    touch_start(integer total_number){
        if (llDetectedKey(0) == llGetOwner()){
        makeTen();
        }
    }
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎