Advertisement
salahzar

orbita ellittica attorno al sole

Apr 26th, 2013
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. float delta=PI/500;
  2.  
  3. vector centro;
  4. float raggio;
  5. float z;
  6. float fi;
  7.  
  8. default
  9. {
  10.     state_entry()
  11.     {
  12.         llSay(0, "Script running");
  13.         llSensor("SOLE",NULL_KEY,PASSIVE | SCRIPTED,20,PI);
  14.     }
  15.     sensor(integer count)
  16.     {
  17.         centro=llDetectedPos(0);
  18.         raggio=3; // llVecDist(llGetPos(),centro);  
  19.         z=centro.z;
  20.         state ready;
  21.        
  22.     }
  23.     no_sensor()
  24.     {
  25.         llSay(0,"Deve esistere un oggetto che fa da centro di nome SOLE");
  26.     }
  27. }
  28. state ready
  29. {
  30.     state_entry()
  31.     {
  32.         llSay(0,"Ready");
  33.         llSay(100,"OFF");
  34.     }
  35.     touch_start(integer count)
  36.     {
  37.         llSay(100,"ON");
  38.         fi=0; llSleep(2);
  39.         for(fi=0;fi<2*PI;fi+=PI/180)
  40.         {            
  41.             vector coord=centro+<raggio*llCos(fi),raggio*1.5*llSin(fi),0>;
  42.             //llOwnerSay((string)fi);
  43.            
  44.             llSetLinkPrimitiveParamsFast(0,[ PRIM_POSITION , coord] );
  45.             llSleep(0.1);
  46.            
  47.         }
  48.         // llSetTimerEvent(0);
  49.         llSay(100,"OFF");
  50.         llSay(0,"Fine rotazione");
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement