Advertisement
salahzar

vai a percorso versione sit con rotazione

Jan 26th, 2014
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. list destinazioni=[
  2.  <64.691162,85.801987,22.183308>,
  3.  <55.000000,98.500000,22.183308>,
  4.  <67.500000,92.500000,22.183308>,
  5.  <71.000000,85.500000,22.183308>,
  6.  <64.691162,85.801987,22.183308>
  7. ];
  8.  
  9. rotation getRotToPointAxisAt(vector axis, vector target) {
  10.     vector mypos=llGetPos();
  11.     target=<target.x,target.y,mypos.z>;
  12.     return llGetRot() * llRotBetween(axis * llGetRot(), target - llGetPos());
  13. }
  14.  
  15. default
  16. {
  17.     state_entry()
  18.     {
  19.         llSitTarget(<0,0,0.5>,llEuler2Rot(<0,0,PI/2>));
  20.     }
  21.    touch_start(integer count)
  22.    {
  23.        integer i; rotation r1=llGetRot();
  24.        for(i=0;i<llGetListLength(destinazioni);i++)
  25.        {
  26.            vector destinazione=llList2Vector(destinazioni,i);
  27.             rotation r=getRotToPointAxisAt(<0,1,0>,destinazione);
  28.    llRotLookAt(r,1.0,10.0);
  29.   // llSetRot(r);
  30.            while(llVecDist(destinazione,llGetPos())>.1)
  31.            {
  32.                 llSetPos(destinazione);
  33.                 llSleep(0.1);
  34.             }
  35.         }
  36.         llSetRot(r1);
  37.    }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement