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
Eyeballs eyeball_follower  

eyeball_follower

eyeball follower.lsl

Category: Eyeballs
By : Anonymous
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for eyeball_follower
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. eyeball_follower_1.lsl
1
2 vector AXIS_UP = <0,0,1>;
3 vector AXIS_LEFT = <0,1,0>;
4 vector AXIS_FWD = <1,0,0>;
5 // Strength and damping are values used to control how llRotLookAt and llLookAt move, these values are tunable.
6 float strength = 1.0;
7 float damping = 1.0;
8
9
10
11 // getRotToPointAxisAt()
12 // Gets the rotation to point the specified axis at the specified position.
13 // @param axis The axis to point. Easiest to just use an AXIS_* constant.
14 // @param target The target, in region-local coordinates, to point the axis at.
15 // @return The rotation necessary to point axis at target.
16 // Created by Ope Rand, modifyed by Christopher Omega
17
18
19 rotation getRotToPointAxisAt(vector axis, vector target)
20 {
21 return llGetRot() * llRotBetween(axis * llGetRot(), target - llGetPos());
22 }
23
24
25 default
26 {
28 {
29 llSensorRepeat("", NULL_KEY, AGENT, 20.0, PI, 2 );
30
31 }
32
33 sensor(integer num)
34 {
35
36
37 vector target = llDetectedPos(0);
38
39
40 // These two lines are equivalent, and point the up (Z) axis at the target:
41 llRotLookAt(getRotToPointAxisAt(AXIS_UP, target), strength, damping);
42 //llLookAt(target, strength, damping);
43
44
45
46 }
47 }
48 // END //

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