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
Physical simulations SL_Molecule_Builder  

SL_Molecule_Builder

* Create an object - preferable long and tall like a pole
* Create a prim to represent each atom and place it in the object
* Place the script below into the first item
* Touch the first item and the atoms will build a C-60 structure

Warning: This is a very prim-intensive activity and may not work on a property already containing buildings. Try the sandboxes to demo it.

Category: Physical simulations
By : Dolyn Foley
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for SL_Molecule_Builder
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. SL_Molecule_Builder_1.lsl
1 list points = [
2 <-0.265,0.328,-0.695>,
3 <-0.164,-0.796,0.000>,
4 <0.594,-0.531,0.164>,
5 <0.000,0.164,0.796>,
6 <-0.164,-0.594,0.531>,
7 <-0.796,0.000,0.164>,
8 <0.164,-0.594,0.531>,
9 <-0.531,0.164,-0.594>,
10 <0.164,0.594,-0.531>,
11 <0.328,0.695,-0.265>,
12 <-0.594,-0.531,0.164>,
13 <-0.594,0.531,-0.164>,
14 <-0.164,-0.594,-0.531>,
15 <-0.265,-0.328,-0.695>,
16 <-0.695,-0.265,0.328>,
17 <0.695,0.265,0.328>,
18 <-0.164,0.796,0.000>,
19 <0.695,0.265,-0.328>,
20 <-0.328,0.695,0.265>,
21 <-0.695,-0.265,-0.328>,
22 <0.796,0.000,0.164>,
23 <0.265,-0.328,0.695>,
24 <0.695,-0.265,-0.328>,
25 <0.000,-0.164,-0.796>,
26 <0.000,-0.164,0.796>,
27 <0.164,0.594,0.531>,
28 <-0.695,0.265,-0.328>,
29 <-0.328,0.695,-0.265>,
30 <0.164,-0.796,0.000>,
31 <0.695,-0.265,0.328>,
32 <-0.531,-0.164,-0.594>,
33 <0.531,0.164,0.594>,
34 <0.265,0.328,0.695>,
35 <0.594,0.531,-0.164>,
36 <-0.594,-0.531,-0.164>,
37 <0.265,-0.328,-0.695>,
38 <0.328,-0.695,0.265>,
39 <0.796,0.000,-0.164>,
40 <-0.531,0.164,0.594>,
41 <-0.695,0.265,0.328>,
42 <-0.265,-0.328,0.695>,
43 <0.594,-0.531,-0.164>,
44 <-0.164,0.594,0.531>,
45 <-0.265,0.328,0.695>,
46 <0.164,0.796,0.000>,
47 <-0.531,-0.164,0.594>,
48 <0.265,0.328,-0.695>,
49 <0.164,-0.594,-0.531>,
50 <0.531,0.164,-0.594>,
51 <0.531,-0.164,0.594>,
52 <-0.164,0.594,-0.531>,
53 <0.328,0.695,0.265>,
54 <0.594,0.531,0.164>,
55 <-0.328,-0.695,-0.265>,
56 <0.000,0.164,-0.796>,
57 <-0.796,0.000,-0.164>,
58 <0.531,-0.164,-0.594>,
59 <0.328,-0.695,-0.265>,
60 <-0.328,-0.695,0.265>,
61 <-0.594,0.531,0.164>
62 ];
63
64 integer totalNumberOfObjects = 0;
65 integer rezCount = 0;
66
67
68 default {
69 on_rez(integer start_param) { llResetScript(); }
70
71 state_entry() {
72 llOwnerSay("Touch to Make Ball - Replace BallObject to change point");
73 }
74
75
76 touch_start(integer total_number) {
77 llOwnerSay("Start");
79 llOwnerSay( "Found: " + rezObjName );
80 vector centerPos = llGetPos();
81
82 totalNumberOfObjects = llGetListLength(points);
83 integer i;
84 for(i=0; i<totalNumberOfObjects; i++) {
85 vector pos = llList2Vector(points, i);
86 llRezObject( rezObjName, centerPos - pos, ZERO_VECTOR, ZERO_ROTATION, i );
87 }
88 }
89
90
91 object_rez(key id) {
92 rezCount++;
93 llOwnerSay("rezed: " + (string)rezCount);
94 if(rezCount>=totalNumberOfObjects) {
95 string scriptName = llGetScriptName();
96 llOwnerSay("Done - Die : " + scriptName);
97 llDie();
98 }
99 }
100
101 }

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