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
Rotation Orbit about a point  

Orbit about a point

Orbit around a point like a moon

Category: Rotation
By : Anonymous
Created: 2013-09-06 Edited: 2013-09-04
Worlds: Second Life

the Zip file

Download all files for Orbit about a point
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Script.lsl
1
2 // Orbitting around a single point with cos and sin.
3 // Made by Juntalis
4 // Cleaned & Hacked by Strife Onizuka
5 vector VECTOR_ORIGIN;
6 float angle;
7 float radius = 1; //in meters out from the start
8 float increment = -5; // positive = counterclockwise
9 default {
10 touch_start(integer total_number)
11 {
12 VECTOR_ORIGIN = llGetPos();
13 llSetTimerEvent(0.01);
14 }
15 timer() {
16 llSetPos( <llCos(angle * DEG_TO_RAD), llSin(angle * DEG_TO_RAD), 0> * radius + VECTOR_ORIGIN );
17 angle += increment;
18 }
19 }

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