Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Building Fix_Repeats_Per_Meter  

Fix_Repeats_Per_Meter

Fix_Repeats_Per_Meter

Category: Building
By : NashBaldwin
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Fix_Repeats_Per_Meter
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Fix_Repeats_Per_Meter_1.lsl
1 default
2 {
4 {
5 // round position to grid
6 float grid = 0.125;
7 vector pos = llGetPos();
8 pos.x = grid * llRound(pos.x / grid);
9 pos.y = grid * llRound(pos.y / grid);
10 pos.z = 27.750;
11 llSetPos(pos);
12
13 // round scale to twice grid
14 grid *= 2.0;
15 vector scale = llGetScale();
16 scale.x = grid * llRound(scale.x / grid);
17 if(scale.x == 0) { scale.x = grid; }
18 scale.y = grid * llRound(scale.y / grid);
19 if(scale.y == 0) { scale.y = grid; }
20 scale.z = 3.0;
21 llSetScale(scale);
22 llSay(0, "scale " + (string)scale);
23
24 // repeats per meter
25 float r = 0.5;
26 llScaleTexture(r*scale.x, r*scale.z, 1);
27 llScaleTexture(r*scale.y, r*scale.z, 2);
28 llScaleTexture(r*scale.x, r*scale.z, 3);
29 llScaleTexture(r*scale.y, r*scale.z, 4);
30
34 }
35 }

Back to the Best Free Tools in Second Life and OpenSim.