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
Camera Multi-Pos Camera HUD  

Multi-Pos Camera HUD

Menu-drive Camera HUD with multiple positions

Category: Camera
By : albertlr Landar
Created: 2015-05-29 Edited: 2015-05-29
Worlds: Second Life

the Zip file

Download all files for Multi-Pos Camera HUD
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Multi-Pos Camera HUD.lsl
1 //:LICENSE: CC-BY-SA
2 //
3 // Rev 1.1 05/14/2015 Pathches to make this actually work by Ferd Frederix - 'agent' was incorrectly used.
4 // Originally from http://forums.osgrid.org/viewtopic.php?f=5&t=3655
5
6 // Well here is the camera hud I promised. It is based on one that was originally released by Dan
7 // Linden a while back. I have modified it and added some new camera views to it. I have also made
8 // sure that the listener turns off after 20 seconds to prevent any lag. I have the full hud available
9 // again at my Freebie Warehouse on austeria9 and it will be in the Wright Plaza Freebie Building.
10 // I also included a modified version of my Lock Hud, however it does not have the toggle option as
11 // that got a little too complicated to implement with the other settings. But it does have an Unlock.
12 // I have the hud using the center placement, but you can place it anywhere on your desktop.
13 //
14 // Instructions:
15 // Insert this script in a small prim. Attach the prim to any convenient HUD position. Click on Cam On to use.
16 // Click on yes to grant permissions - if you click on no you will not be able to run any of the cam settings.
17 // You can turn the cam hud off by clicking Cam Off. There is a 20 second timer which will turn the listener
18 // off to prevent lag.
19
20 // Choose one of the Cam Buttons. Sometimes you will need to touch an arrow key in order
21 // for the camera to change settings. If you choose the Lock Cam button the hud will turn red to indicate
22 // this selection. You can then go to other settings however it is best to click Unlock Cam to turn it off,
23 // and return the hud to Blue. The Focus On Me Cam will give you an overhead view of your avatar, good
24 // for use in a crowded area such as a club. Click on the same Focus On Me Button to release this view.
25 // The Hip Cam is good for tunnels, or low ceiling areas and can be used for Tiny Avatars. The Large Avatar
26 // Cam is for a large Avatar point of view, this is normally done with an animation which will raise your
27 // avatar about 5 meters in the air. The other buttons should be self explainatory. Please feel free to
28 // make adjustments or additions to your own preferences. But if you come up with new and better
29 // setting please share with everyone.
30
31
32 // SOURCE
33 // Camera Hud OS.lsl
34 // Put this script in a prim and attach the prim as HUD. Click the HUD and select your camera position in the dialog menu
35
36 // Originally created by Linden Labs Dan Linden
37 //Modified and Enhanced by albertlr Landar for OSGRID
38 // This program is free software; you can redistribute it and/or modify it.
39 // License information must be included in any script you give out or use.
40 // This script is licensed under the Creative Commons Attribution-Share Alike 3.0
41 // License from http://creativecommons.org/licenses/by-sa/3.0 unless licenses are
42 // included in the script or comments by the original author,in which case
43 // the authors license must be followed.
44
45 // Please leave any authors credits intact in any script you use or publish.
46 ///////////////////////////////////////////////////////////////////////////////
47
48 vector CamPos;
49 rotation CamRot;
50 vector CamFoc;
51 integer CHANNEL; // dialog channel
52 float Timeout=60.0;
53
54 //**********************
55 list MENU_MAIN = ["Default", "Overhead Cam", "Focus On Me", "Hip Cam", "Drop Cam 5", "5M Large Av", "Driving Cam", "LOCK Cam", "UNLOCK Cam", "Cam ON", "Cam OFF", "More..."]; // the main menu
56 //**********************
57 list MENU_2 = ["Cr Shoulder", "L Shoulder", "R Shoulder", "L Side Cam", "R Side Cam", "Spaz Cam", "Spin Cam", "Worm Cam", "...Back"]; // menu 2
58
59 integer spaz = 0;
60 integer trap = 0;
61 integer handle;
62
63
64 release_camera_control()
65 {
66 llSetCameraParams([CAMERA_ACTIVE, 0]); // 1 is active, 0 is inactive
68 }
69
70 focus_on_me()
71 {
72 //llOwnerSay("focus_on_me"); // say function name for debugging
73 llClearCameraParams(); // reset camera to default
74 vector here = llGetPos();
76 CAMERA_ACTIVE, 1, // 1 is active, 0 is inactive
77 CAMERA_BEHINDNESS_ANGLE, 180.0, // (0 to 180) degrees
78 CAMERA_BEHINDNESS_LAG, 0.0, // (0 to 3) seconds
79 CAMERA_DISTANCE, 0.0, // ( 0.5 to 10) meters
80 CAMERA_FOCUS, here, // region relative position
81 CAMERA_FOCUS_LAG, 0.0 , // (0 to 3) seconds
82 CAMERA_FOCUS_LOCKED, TRUE, // (TRUE or FALSE)
83 CAMERA_FOCUS_THRESHOLD, 0.0, // (0 to 4) meters
84 // PITCH" title="View Definition" class="tooltip">CAMERA_PITCH, 80.0, // (-45 to 80) degrees
85 CAMERA_POSITION, here + <4.0,4.0,4.0>, // region relative position
86 CAMERA_POSITION_LAG, 0.0, // (0 to 3) seconds
87 CAMERA_POSITION_LOCKED, TRUE, // (TRUE or FALSE)
88 CAMERA_POSITION_THRESHOLD, 0.0, // (0 to 4) meters
89 CAMERA_FOCUS_OFFSET, ZERO_VECTOR // <-10,-10,-10> to <10,10,10> meters
90 ]);
91 }
92
93 default_cam()
94 {
95 // llOwnerSay("default_cam"); // say function name for debugging
96 llClearCameraParams(); // reset camera to default
97 llSetCameraParams([CAMERA_ACTIVE, 1]);
98 }
99
100 driving_cam()
101 {
102 // llOwnerSay("driving_cam"); // say function name for debugging
103 default_cam();
105 CAMERA_ACTIVE, 1, // 1 is active, 0 is inactive
106 CAMERA_BEHINDNESS_ANGLE, 90.0, // (0 to 180) degrees
107 CAMERA_BEHINDNESS_LAG, 0.5, // (0 to 3) seconds
108 CAMERA_DISTANCE, 8.0, // ( 0.5 to 10) meters
109 //CAMERA_FOCUS, <0,0,5>, // region relative position
110 CAMERA_FOCUS_LAG, 0.05 , // (0 to 3) seconds
111 CAMERA_FOCUS_LOCKED, FALSE, // (TRUE or FALSE)
112 CAMERA_FOCUS_THRESHOLD, 0.0, // (0 to 4) meters
113 PITCH" title="View Definition" class="tooltip">CAMERA_PITCH, 20.0, // (-45 to 80) degrees
114 //CAMERA_POSITION, <0,0,0>, // region relative position
115 CAMERA_POSITION_LAG, 0.1, // (0 to 3) seconds
116 CAMERA_POSITION_LOCKED, FALSE, // (TRUE or FALSE)
117 CAMERA_POSITION_THRESHOLD, 0.0, // (0 to 4) meters
118 CAMERA_FOCUS_OFFSET, <3,0,2> // <-10,-10,-10> to <10,10,10> meters
119 ]);
120 }
121
122 large()
123 {
124 // llOwnerSay("Large Av Cam"); // say function name for debugging
125 default_cam();
127 CAMERA_ACTIVE, 1, // 1 is active, 0 is inactive
128 CAMERA_BEHINDNESS_ANGLE, 90.0, // (0 to 180) degrees
129 CAMERA_BEHINDNESS_LAG, 0.5, // (0 to 3) seconds
130 CAMERA_DISTANCE, 8.0, // ( 0.5 to 10) meters
131 //CAMERA_FOCUS, <0,0,5>, // region relative position
132 CAMERA_FOCUS_LAG, 0.05 , // (0 to 3) seconds
133 CAMERA_FOCUS_LOCKED, FALSE, // (TRUE or FALSE)
134 CAMERA_FOCUS_THRESHOLD, 0.0, // (0 to 4) meters
135 PITCH" title="View Definition" class="tooltip">CAMERA_PITCH, 20.0, // (-45 to 80) degrees
136 //CAMERA_POSITION, <0,0,0>, // region relative position
137 CAMERA_POSITION_LAG, 0.1, // (0 to 3) seconds
138 CAMERA_POSITION_LOCKED, FALSE, // (TRUE or FALSE)
139 CAMERA_POSITION_THRESHOLD, 0.0, // (0 to 4) meters
140 CAMERA_FOCUS_OFFSET, <3,0,5> // <-10,-10,-10> to <10,10,10> meters
141 ]);
142 }
143
144 r_shoulder_cam()
145 {
146 // llOwnerSay("right cam"); // say function name for debugging
147 default_cam();
149 CAMERA_ACTIVE, 1, // 1 is active, 0 is inactive
150 CAMERA_BEHINDNESS_ANGLE, 5.0, // (0 to 180) degrees
151 CAMERA_BEHINDNESS_LAG, 0.5, // (0 to 3) seconds
152 CAMERA_DISTANCE, 0.5, // ( 0.5 to 10) meters
153 //CAMERA_FOCUS, <0,0,5>, // region relative position
154 CAMERA_FOCUS_LAG, 0.01 , // (0 to 3) seconds
155 CAMERA_FOCUS_LOCKED, FALSE, // (TRUE or FALSE)
156 CAMERA_FOCUS_THRESHOLD, 0.0, // (0 to 4) meters
157 PITCH" title="View Definition" class="tooltip">CAMERA_PITCH, 15.0, // (-45 to 80) degrees
158 CAMERA_POSITION, <0.0,0.0,0.0>, // region relative position
159 CAMERA_POSITION_LAG, 0.1, // (0 to 3) seconds
160 CAMERA_POSITION_LOCKED, FALSE, // (TRUE or FALSE)
161 CAMERA_POSITION_THRESHOLD, 0.0, // (0 to 4) meters
162 CAMERA_FOCUS_OFFSET, <-0.5,-0.5,1.0> // <-10,-10,-10> to <10,10,10> meters
163 ]);
164 }
165
166 l_shoulder_cam()
167 {
168 // llOwnerSay("left cam"); // say function name for debugging
169 default_cam();
171 CAMERA_ACTIVE, 1, // 1 is active, 0 is inactive
172 CAMERA_BEHINDNESS_ANGLE, 5.0, // (0 to 180) degrees
173 CAMERA_BEHINDNESS_LAG, 0.5, // (0 to 3) seconds
174 CAMERA_DISTANCE, 0.5, // ( 0.5 to 10) meters
175 //CAMERA_FOCUS, <0,0,5>, // region relative position
176 CAMERA_FOCUS_LAG, 0.01 , // (0 to 3) seconds
177 CAMERA_FOCUS_LOCKED, FALSE, // (TRUE or FALSE)
178 CAMERA_FOCUS_THRESHOLD, 0.0, // (0 to 4) meters
179 PITCH" title="View Definition" class="tooltip">CAMERA_PITCH, 15.0, // (-45 to 80) degrees
180 CAMERA_POSITION, <0.0,0.0,0.0>, // region relative position
181 CAMERA_POSITION_LAG, 0.1, // (0 to 3) seconds
182 CAMERA_POSITION_LOCKED, FALSE, // (TRUE or FALSE)
183 CAMERA_POSITION_THRESHOLD, 0.0, // (0 to 4) meters
184 CAMERA_FOCUS_OFFSET, <-0.5,0.5,1.0> // <-10,-10,-10> to <10,10,10> meters
185 ]);
186 }
187
188 shoulder_cam()
189 {
190 // llOwnerSay("shoulder cam"); // say function name for debugging
191 default_cam();
193 CAMERA_ACTIVE, 1, // 1 is active, 0 is inactive
194 CAMERA_BEHINDNESS_ANGLE, 5.0, // (0 to 180) degrees
195 CAMERA_BEHINDNESS_LAG, 0.0, // (0 to 3) seconds
196 CAMERA_DISTANCE, 1.0, // region relative position
197 CAMERA_FOCUS_LAG, 0.01 , // (0 to 3) seconds
198 CAMERA_FOCUS_LOCKED, FALSE, // (TRUE or FALSE)
199 CAMERA_FOCUS_THRESHOLD, 0.0, // (0 to 4) meters
200 PITCH" title="View Definition" class="tooltip">CAMERA_PITCH, 15.0, // (-45 to 80) degrees
201 //CAMERA_POSITION, <0,0,0>, // region relative position
202 CAMERA_POSITION_LAG, 0.1, // (0 to 3) seconds
203 CAMERA_POSITION_LOCKED, FALSE, // (TRUE or FALSE)
204 CAMERA_POSITION_THRESHOLD, 0.0, // (0 to 4) meters
205 CAMERA_FOCUS_OFFSET, <0.0,0.0,1.0> // <-10,-10,-10> to <10,10,10> meters
206 ]);
207 }
208
209 l_side_cam()
210 {
211 // llOwnerSay("l_side_cam"); // say function name for debugging
212 default_cam();
214 CAMERA_ACTIVE, 1, // 1 is active, 0 is inactive
215 CAMERA_BEHINDNESS_ANGLE, 0.0, // (0 to 180) degrees
216 CAMERA_BEHINDNESS_LAG, 0.0, // (0 to 3) seconds
217 CAMERA_DISTANCE, 3.0, // ( 0.5 to 10) meters
218 //CAMERA_FOCUS, <0,0,5>, // region relative position
219 CAMERA_FOCUS_LAG, 0.0 , // (0 to 3) seconds
220 // CAMERA_FOCUS_LOCKED, FALSE, // (TRUE or FALSE)
221 CAMERA_FOCUS_THRESHOLD, 0.0, // (0 to 4) meters
222 // PITCH" title="View Definition" class="tooltip">CAMERA_PITCH, 80.0, // (-45 to 80) degrees
223 //CAMERA_POSITION, <0,0,0>, // region relative position
224 CAMERA_POSITION_LAG, 0.0, // (0 to 3) seconds
225 // CAMERA_POSITION_LOCKED, FALSE, // (TRUE or FALSE)
226 CAMERA_POSITION_THRESHOLD, 0.0, // (0 to 4) meters
227 CAMERA_FOCUS_OFFSET, <0,1.5,0> // <-10,-10,-10> to <10,10,10> meters
228 ]);
229 }
230
231 r_side_cam()
232 {
233 // llOwnerSay("r_side_cam"); // say function name for debugging
234 default_cam();
236 CAMERA_ACTIVE, 1, // 1 is active, 0 is inactive
237 CAMERA_BEHINDNESS_ANGLE, 0.0, // (0 to 180) degrees
238 CAMERA_BEHINDNESS_LAG, 0.0, // (0 to 3) seconds
239 CAMERA_DISTANCE, 3.0, // ( 0.5 to 10) meters
240 //CAMERA_FOCUS, <0,0,5>, // region relative position
241 CAMERA_FOCUS_LAG, 0.0 , // (0 to 3) seconds
242 // CAMERA_FOCUS_LOCKED, FALSE, // (TRUE or FALSE)
243 CAMERA_FOCUS_THRESHOLD, 0.0, // (0 to 4) meters
244 // PITCH" title="View Definition" class="tooltip">CAMERA_PITCH, 80.0, // (-45 to 80) degrees
245 //CAMERA_POSITION, <0,0,0>, // region relative position
246 CAMERA_POSITION_LAG, 0.0, // (0 to 3) seconds
247 // CAMERA_POSITION_LOCKED, FALSE, // (TRUE or FALSE)
248 CAMERA_POSITION_THRESHOLD, 0.0, // (0 to 4) meters
249 CAMERA_FOCUS_OFFSET, <0,-1.5,0> // <-10,-10,-10> to <10,10,10> meters
250 ]);
251 }
252
253 overhead_cam()
254 {
255 // llOwnerSay("overhead_cam"); // say function name for debugging
256 default_cam();
258 CAMERA_ACTIVE, 1, // 1 is active, 0 is inactive
259 CAMERA_BEHINDNESS_ANGLE, 180.0, // (0 to 180) degrees
260 CAMERA_BEHINDNESS_LAG, 0.5, // (0 to 3) seconds
261 CAMERA_DISTANCE, 10.0, // ( 0.5 to 10) meters
262 //CAMERA_FOCUS, <0,0,5>, // region relative position
263 CAMERA_FOCUS_LAG, 0.05 , // (0 to 3) seconds
264 CAMERA_FOCUS_LOCKED, FALSE, // (TRUE or FALSE)
265 CAMERA_FOCUS_THRESHOLD, 0.0, // (0 to 4) meters
266 PITCH" title="View Definition" class="tooltip">CAMERA_PITCH, 80.0, // (-45 to 80) degrees
267 //CAMERA_POSITION, <0,0,0>, // region relative position
268 CAMERA_POSITION_LAG, 0.0, // (0 to 3) seconds
269 CAMERA_POSITION_LOCKED, FALSE, // (TRUE or FALSE)
270 CAMERA_POSITION_THRESHOLD, 0.0, // (0 to 4) meters
271 CAMERA_FOCUS_OFFSET, <0,0,0> // <-10,-10,-10> to <10,10,10> meters
272 ]);
273 }
274
275 drop_camera_5_seconds()
276 {
277 // llOwnerSay("drop_camera_5_seconds"); // say function name for debugging
279 CAMERA_ACTIVE, 1, // 1 is active, 0 is inactive
280 CAMERA_BEHINDNESS_ANGLE, 0.0, // (0 to 180) degrees
281 CAMERA_BEHINDNESS_LAG, 0.5, // (0 to 3) seconds
282 CAMERA_DISTANCE, 3.0, // ( 0.5 to 10) meters
283 //CAMERA_FOCUS, <0,0,5>, // region relative position
284 CAMERA_FOCUS_LAG, 2.0, // (0 to 3) seconds
285 CAMERA_FOCUS_LOCKED, FALSE, // (TRUE or FALSE)
286 CAMERA_FOCUS_THRESHOLD, 0.0, // (0 to 4) meters
287 PITCH" title="View Definition" class="tooltip">CAMERA_PITCH, 0.0, // (-45 to 80) degrees
288 //CAMERA_POSITION, <0,0,0>, // region relative position
289 CAMERA_POSITION_LAG, 0.05, // (0 to 3) seconds
290 CAMERA_POSITION_LOCKED, TRUE, // (TRUE or FALSE)
291 CAMERA_POSITION_THRESHOLD, 0.0, // (0 to 4) meters
292 CAMERA_FOCUS_OFFSET, <0,0,0> // <-10,-10,-10> to <10,10,10> meters
293 ]);
294 llSleep(5);
295 default_cam();
296 }
297
298 worm_cam()
299 {
300 // llOwnerSay("worm_cam"); // say function name for debugging
301 default_cam();
303 CAMERA_ACTIVE, 1, // 1 is active, 0 is inactive
304 CAMERA_BEHINDNESS_ANGLE, 180.0, // (0 to 180) degrees
305 CAMERA_BEHINDNESS_LAG, 0.0, // (0 to 3) seconds
306 CAMERA_DISTANCE, 3.0, // ( 0.5 to 10) meters
307 //CAMERA_FOCUS, <0,0,5>, // region relative position
308 CAMERA_FOCUS_LAG, 0.0 , // (0 to 3) seconds
309 CAMERA_FOCUS_LOCKED, FALSE, // (TRUE or FALSE)
310 CAMERA_FOCUS_THRESHOLD, 2.0, // (0 to 4) meters
311 PITCH" title="View Definition" class="tooltip">CAMERA_PITCH, -30.0, // (-45 to 80) degrees
312 //CAMERA_POSITION, <0,0,0>, // region relative position
313 CAMERA_POSITION_LAG, 1.0, // (0 to 3) seconds
314 CAMERA_POSITION_LOCKED, FALSE, // (TRUE or FALSE)
315 CAMERA_POSITION_THRESHOLD, 1.0, // (0 to 4) meters
316 CAMERA_FOCUS_OFFSET, <0,0,0> // <-10,-10,-10> to <10,10,10> meters
317 ]);
318 }
319
320
321 spaz_cam()
322 {
323 // llOwnerSay("spaz_cam for 5 seconds"); // say function name for debugging
324 float i;
325 for (i=0; i< 50; i+=1)
326 {
327 vector xyz = llGetPos() + <llFrand(80) - 40, llFrand(80) - 40, llFrand(10)>;
328 // llOwnerSay((string)xyz);
329 vector xyz2 = llGetPos() + <llFrand(80) - 40, llFrand(80) - 40, llFrand(10)>;
331 CAMERA_ACTIVE, 1, // 1 is active, 0 is inactive
332 CAMERA_BEHINDNESS_ANGLE, 180.0, // (0 to 180) degrees
333 CAMERA_BEHINDNESS_LAG, llFrand(3), // (0 to 3) seconds
334 CAMERA_DISTANCE, llFrand(10), // ( 0.5 to 10) meters
335 //CAMERA_FOCUS, xyz, // region relative position
336 CAMERA_FOCUS_LAG, llFrand(3), // (0 to 3) seconds
337 CAMERA_FOCUS_LOCKED, TRUE, // (TRUE or FALSE)
338 CAMERA_FOCUS_THRESHOLD, llFrand(4), // (0 to 4) meters
339 PITCH" title="View Definition" class="tooltip">CAMERA_PITCH, llFrand(125) - 45, // (-45 to 80) degrees
340 CAMERA_POSITION, xyz2, // region relative position
341 CAMERA_POSITION_LAG, llFrand(3), // (0 to 3) seconds
342 CAMERA_POSITION_LOCKED, TRUE, // (TRUE or FALSE)
343 CAMERA_POSITION_THRESHOLD, llFrand(4), // (0 to 4) meters
344 CAMERA_FOCUS_OFFSET, <llFrand(20) - 10, llFrand(20) - 10, llFrand(20) - 10> // <-10,-10,-10> to <10,10,10> meters
345 ]);
346 llSleep(0.1);
347 }
348 default_cam();
349 }
350
351 hip_cam()
352 {
353 // llOwnerSay("hip_cam"); // say function name for debugging
354 default_cam();
356 CAMERA_ACTIVE, 1, // 1 is active, 0 is inactive
357 CAMERA_BEHINDNESS_ANGLE, 0.01, // (0 to 180) degrees
358 CAMERA_BEHINDNESS_LAG, 0.05, // (0 to 3) seconds
359 CAMERA_DISTANCE, 4.0, // ( 0.5 to 10) meters
360 //CAMERA_FOCUS, <0,0,5>, // region relative position
361 CAMERA_FOCUS_LAG, 0.01 , // (0 to 3) seconds
362 CAMERA_FOCUS_LOCKED, FALSE, // (TRUE or FALSE)
363 CAMERA_FOCUS_THRESHOLD, 0.0, // (0 to 4) meters
364 PITCH" title="View Definition" class="tooltip">CAMERA_PITCH, 10.0, // (-45 to 80) degrees
365 //CAMERA_POSITION, <0,0,0>, // region relative position
366 CAMERA_POSITION_LAG, 0.01, // (0 to 3) seconds
367 CAMERA_POSITION_LOCKED, FALSE, // (TRUE or FALSE)
368 CAMERA_POSITION_THRESHOLD, 0.0, // (0 to 4) meters
369 CAMERA_FOCUS_OFFSET, <0,0,0> // <-10,-10,-10> to <10,10,10> meters
370 ]);
371 }
372
373 Lock()
374 {
375 llOwnerSay("Locking current camera position.");
376 CamPos = llGetCameraPos();
377 CamRot = llGetCameraRot();
378 CamFoc = CamPos + llRot2Fwd(CamRot);
379 llSetColor(<1,0,0>,ALL_SIDES);
381 CAMERA_ACTIVE, 1,
382 CAMERA_FOCUS, CamFoc,
383 CAMERA_POSITION, CamPos,
384 CAMERA_FOCUS_LOCKED, 1,
385 CAMERA_POSITION_LOCKED, 1
386 ]);
387 vector CamFocStr = CamFoc;
388 vector CamPosStr = CamPos;
389 }
390
391 Unlock()
392 {
393 llSetColor(<0,0,1>,ALL_SIDES);
394 llOwnerSay("Unlocking current camera position.");
396 CAMERA_ACTIVE, 1,
397 CAMERA_FOCUS, CamFoc,
398 CAMERA_POSITION, CamPos,
399 CAMERA_FOCUS_LOCKED, 0,
400 CAMERA_POSITION_LOCKED, 0
401 ]);
402 }
403
404
405 spin_cam()
406 {
407 // llOwnerSay("spin_cam"); // say function name for debugging
408 default_cam();
410 CAMERA_ACTIVE, 1, // 1 is active, 0 is inactive
411 CAMERA_BEHINDNESS_ANGLE, 180.0, // (0 to 180) degrees
412 CAMERA_BEHINDNESS_LAG, 0.5, // (0 to 3) seconds
413 //CAMERA_DISTANCE, 10.0, // ( 0.5 to 10) meters
414 //CAMERA_FOCUS, <0,0,5>, // region relative position
415 CAMERA_FOCUS_LAG, 0.05 , // (0 to 3) seconds
416 CAMERA_FOCUS_LOCKED, FALSE, // (TRUE or FALSE)
417 CAMERA_FOCUS_THRESHOLD, 0.0, // (0 to 4) meters
418 PITCH" title="View Definition" class="tooltip">CAMERA_PITCH, 30.0, // (-45 to 80) degrees
419 //CAMERA_POSITION, <0,0,0>, // region relative position
420 CAMERA_POSITION_LAG, 0.0, // (0 to 3) seconds
421 CAMERA_POSITION_LOCKED, FALSE, // (TRUE or FALSE)
422 CAMERA_POSITION_THRESHOLD, 0.0, // (0 to 4) meters
423 CAMERA_FOCUS_OFFSET, <0,0,0> // <-10,-10,-10> to <10,10,10> meters
424 ]);
425
426 float i;
427 vector camera_position;
428 for (i=0; i< 2*TWO_PI; i+=.05)
429 {
430 camera_position = llGetPos() + <0, 4, 0> * llEuler2Rot(<0,0,i>);
431 llSetCameraParams([CAMERA_POSITION, camera_position]);
432 llSleep(0.1);
433 }
434 default_cam();
435 }
436
437 Menu()
438 {
439 llSetTimerEvent(Timeout);
440 handle = llListen(CHANNEL, "","", ""); // listen for dialog answers
441 llDialog(llAvatarOnSitTarget(), "What do you want to do?", MENU_MAIN, CHANNEL); // present dialog on click
442 }
443
444
445 Menu2()
446 {
447 llSetTimerEvent(Timeout);
448 handle = llListen(CHANNEL, "","", ""); // listen for dialog answers
449 llDialog(llAvatarOnSitTarget(), "Pick an option!", MENU_2, CHANNEL); // present submenu on request
450 }
451
452 default
453 {
455 {
456 CHANNEL = llRound(llFrand(1) * 100000);
457 llSitTarget(<0.2,0,0.5>,ZERO_ROTATION);
458 llSetSitText("Action!");
459 }
460
461 touch_start(integer total_number)
462 {
464 Menu();
465 }
466
467 listen(integer CHANNEL, string name, key id, string message)
468 {
469 llListenRemove(handle);
470
471 if(message == "More...")
472 Menu2();
473 else if(message == "...Back")
474 Menu();
475
476 else if(message == "Cam ON"){
478 } else if(message == "Cam OFF") {
479 release_camera_control();
480 } else if(message == "Default"){
481 default_cam();
482 Menu();
483 }else if(message == "Driving Cam"){
484 driving_cam();
485 Menu();
486 }else if(message == "5M Large Av"){
487 large();
488 Menu();
489 }else if(message == "L Shoulder"){
490 l_shoulder_cam();
491 Menu();
492 }else if(message == "R Shoulder"){
493 r_shoulder_cam();
494 Menu();
495 }else if(message == "Cr Shoulder"){
496 shoulder_cam();
497 Menu();
498 }else if(message == "Worm Cam"){
499 worm_cam();
500 Menu();
501 }else if(message == "Overhead Cam"){
502 overhead_cam();
503 Menu();
504 }else if(message == "Spaz Cam"){
505 spaz_cam();
506 Menu();
507 }else if(message == "L Side Cam"){
508 l_side_cam();
509 Menu();
510 }else if(message == "R Side Cam"){
511 r_side_cam();
512 Menu();
513 }else if(message == "Drop Cam 5"){
514 drop_camera_5_seconds();
515 Menu();
516 }else if(message == "Hip Cam"){
517 hip_cam();
518 Menu();
519 }else if(message == "LOCK Cam"){
520 Lock();
521 Menu();
522 }else if(message == "UNLOCK Cam"){
523 Unlock();
524 Menu();
525 }else if(message == "Focus On Me"){
526 trap = !trap;
527 if(trap == 1) {
528 llOwnerSay("focus is on me");
529 focus_on_me();
530 Menu();
531 }else {
532 llOwnerSay("focus is off me");
533 default_cam();
534 Menu();
535 }
536 } else if(message == "Spin Cam"){
537 spin_cam();
538 Menu();
539 }
540 }
541
542 changed(integer what)
543 {
544 if(what & CHANGED_LINK)
545 {
547 if(avi != NULL_KEY) {
548 Menu();
549 }
550 }
551 }
552
555 Menu();
556 llSetCameraParams([CAMERA_ACTIVE, 1]); // 1 is active, 0 is inactive
557 }
558 }
559
560 timer()
561 {
563 llOwnerSay("Menu timeout");
564 llListenControl(handle, FALSE);
565 }
566 }

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