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
Terrain Land to Sculpt Maker  

Land to Sculpt Maker

Makes a 32 X 32 sculpt fo the the terrain under the prim.

Category: Terrain
By : Unknown
Created: 2016-01-23 Edited: 2016-01-23
Worlds: OpenSim

the Zip file

Download all files for Land to Sculpt Maker
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Script.lsl
1 string int2hex(integer x)
2 {
3 string hex="0123456789ABCDEF";
4 return llGetSubString(hex, (x >> 4), (x >> 4)) +
5 llGetSubString(hex, x & 0xF, x & 0xF);
6 }
7 default
8 {
10 {
12 }
14 {
15 llOwnerSay("Script running");
16 }
17 touch_end(integer touched)
18 {
20 {
21 llOwnerSay("Starting...");
22 float mapX = 0.0;
23 float mapY = 0.0;
24 float mapZ = 0.0;
25 integer x = 0;
26 integer y = 0;
27 integer z = 0;
28 integer offsetX = 0;
29 integer offsetY = 0;
30 string colorX = "";
31 string colorY = "";
32 string colorZ = "";
33 string draw = osSetPenSize("", 1);
34 vector pos = llGetPos();
35 for (; y < 64; y++)
36 {
37 draw = osMovePen(draw, 0, y);
38 offsetX = 0;
39 if(y == 63) offsetY = 1;
40 for (x = 0; x < 64; x++)
41 {
42 if(x == 63) offsetX = 1;
43 mapX = ((float)x + offsetX) / 2.0 - 16.0;
44 mapY = ((float)y + offsetY) / 2.0 - 16.0;
45 mapZ = llGround(<mapX, mapY, 0.0>);
46 if(mapZ > (pos.z + 16.0)) z = 255;
47 else if(mapZ < (pos.z - 16.0)) z = 0;
48 else { z = llRound((mapZ - (pos.z - 16.0)) * 8.0); }
49 if(x == 63) colorX = "FF";
50 else colorX = int2hex(x * 4);
51 if(y == 63) colorY = "FF";
52 else colorY = int2hex(y * 4);
53 if(z == 256) colorZ = "FF";
54 else colorZ = int2hex(z);
55 draw = osSetPenColor(draw, "FF" + colorX + colorY + colorZ);
56 draw = osDrawLine(draw, x, y, x + 1, y);
57 }
58 }
59 osSetDynamicTextureDataBlendFace("", "vector", draw, "width:64,height:64", FALSE, 2, 0, 255, 1);
61 state done;
62 }
63 }
64 }
65 state done
66 {
68 {
70 llOwnerSay("Done.");
72 }
73 }

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