Jump to content

Daniells Brandi

Resident
  • Posts

    38
  • Joined

  • Last visited

Posts posted by Daniells Brandi

  1.  mollymeus,  your code is perfect, I did the test and saw that it does not work on physical objects.

      It would have some code like this for physical object.
      I need a seaplane to level (align) at  height determined by user.

     

    I was working with  'VEHICLE_ANGULAR_MOTOR_DIRECTION'  but the plane keeps going up or down even when the value set to 0,

     it makes the plane oscillate all the time, I  need more precision I'm out of ideas.

  2. yes, but I would like for example to rotate 10 degrees up, but without changing the direction of the prim.

     

            ///////////////////////////////////////////////////////////////////////// 
            vector vOffset2 = <1,0,0> * llGetRot();
            vector noY = <llVecMag(<vOffset2.x, vOffset2.y, 0.0>), 0.0, vOffset2.z>;
            integer pitch = llRound(llAtan2(noY.z, noY.x) * RAD_TO_DEG);   
            /////////////////////////////////////////////////////////////////////////

     

    would be the reverse process of this code.
      This code gives me the pitch, but I want the object to have a pitch set by me

  3.   I have a problem rotating a prim, I found some examples, but in the example, explain to rotate the prim in one of the 3 axes. I need the prim to rotate (up or down) always in front. The front would be the coordinate E on the world map and zero rotation on first rez.

     

    413213651_boxexemple.jpg.8f3fb462636ed626f077a037642e36b8.jpg

     Thanks

  4.  Hello Innula ZenovkaI appreciate your help, but I still do not understand what I should do, I will try to illustrate better ..

     

    I have a fixed point on the world map, this point I already have. Example vector fix_point = <305310.70000, 234906.70000, 27.44904>

    indicated by the Red Point the image

    I only need x and y.

     

    I have my position on the world map using  llGetRegionCorner()+llGetPos();  In real time.

    indicated by the Blue Point the image

     

    I have a compass that indicates my rotation in the world

    80 ° in the picture

     

    I need to know, which direction (which angle ?° relative to the compass) I must take to get to this fixed point.

    In the example image, I know that I must take the 235 ° direction to get to the fixed point,

      but how to find the direction in the virtual world?

    (remembering that I will be moving, so this direction will not be fixed)

     

    exmple.thumb.jpg.73b3d470c8b3afb694646f5fdc591906.jpg

     

    I tried to use your formula, but I was unsuccessful, it really seems to be very difficult to work with angles.

     

    A second image as an example, I'm in another place in the world....

     

    exemple_2.thumb.jpg.11f767d55b2ce6838474b91d209a2564.jpg

     

    thanking for the help.

  5. Thanks for the help Mollymews.
      It seems a little difficult for me, so far I have a compass and managed to find the angle that I find myself in the world in relation to the fixed point.
      But what I need is to know which angle to follow to get to the fixed point.

     

    vector fix_point = <305310.70000, 234906.70000, 20>; //any position in the world
    default
    {
        state_entry()
        {
            llSetTimerEvent(0.1);
        }   
        timer()
        {
    /////////////////////////////////////////////////////////////////////
    //////////////// RELATION TO FIXED POINT /////////////////////////////      
            vector my_pos = (llGetRegionCorner()+llGetPos()); 
            my_pos = my_pos - fix_point;
            
            float angle = llAtan2(my_pos.x,my_pos.y) * RAD_TO_DEG;
            if(angle < 0.0)
            angle += 360.0;
            angle * DEG_TO_RAD;
    
    /////////////////////////////////////////////////////////////////////
    //////////////// COMPASS //////////////////////////////////////////// 
            rotation currRot=llGetRot();
            vector currEuler=llRot2Euler(currRot);
            float zRotAngle=currEuler.z;
    
            float heading=PI_BY_TWO-zRotAngle;
            while (heading<0) 
            heading+=TWO_PI;
            heading=heading*RAD_TO_DEG;
    /////////////////////////////////////////////////////////////////////////    
            llSetText("Angle" + (string)angle + "° |" + "Compass=" + (string)heading + "°",<1,1,1>, TRUE );
            ]);            
        }
    }

     

  6.  Hello guys, I need a quick cleanup of this string in http_response..

     

    {"dat":[{"length":37,"rid":"pro.ts","text":["I just want this part of the string"]}]}

     I take only the part in bold

     thank you for help.

  7. problem with camera

    ended a vehicle (plane) that uses only one configuration of dynamic camera but an error always happens almost always when exchanging island (when I go to a continent) was passed with a vehicle with a little rotation (bow making) the camera back to the correct position, but whenever we step from one island to another with the vehicle in a straight line, the camera is screwed (prey) and not the avatar back to the correct position, being sometimes even reversed (the correct position would be behind the avatar)

    I tried several changes, one of which was to update the camera whenever change, but still not got success.

    could someone help me? thanks

  8.  hello guys, I need help with this script, make the rotation happens smoothly. (with steps)

     

    vector r_open = <170.0, 76.0, 143.0>;
    vector r_close = <0.0, 90.0, 90.0>;
    
    rotation LocalRot(rotation localrot)
    {
        rotation LocRot = localrot / ( (ZERO_ROTATION / llGetLocalRot()) * llGetRot());
        return LocRot;
    }
    
    OPEN()
    {
        llSetPrimitiveParams([PRIM_ROTATION, LocalRot(llEuler2Rot(r_open * DEG_TO_RAD))]);
    }
    
    CLOSE()
    {
        llSetPrimitiveParams([PRIM_ROTATION, LocalRot(llEuler2Rot(r_close* DEG_TO_RAD))]);
    }

     

     thanks!

  9.   I have a script type of carrier aviation, works perfect, but I would aidiconar a move would make the plane turn in the air (when squeezed or D key) without losing direction.

     

      giro.png

     

    rotate the image in the green direction
    keep the red direction (forward and back) the image.

     

     

     thanks

  10.  Dora, I got this way ..

     

    list alphabet = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"," "];string message = "20:15 event_one|21:12 new_event|23:55 Hello all";default{    state_entry()    {        list my_list = [];        string convertedtext;        integer i;                for(i == 0; i < llStringLength(llToLower(message)); ++ i)        {          if(llListFindList(alphabet,[llGetSubString(llToLower(message),i,i)]) == -1)          {             convertedtext = convertedtext + llGetSubString(llToLower(message),i,i);          }        }                my_list = llParseString2List(convertedtext,["|","_","-"],[]);                llOwnerSay(llList2CSV(my_list));                                                              }}

     

  11. Sorry dora, I am new to scripting, still learning xD

     

    I am posting a complete example of what I wanted, the string will always get this format, but will not be fixed..

     

    default
    {
        touch_start(integer total_number)
        {
            string exemple = "20:15 event_one|21:12 new_event|23:55 Hello all";
       
            list mylist = llParseString2List(exemple, [":","|"], []);
    //        llOwnerSay(llList2CSV(mylist));       
            integer i = llGetListLength( mylist );
            while ( i-- )
            if ( llList2String( mylist, i) != (string)llList2Integer( mylist, i)) mylist = llDeleteSubList( mylist, i, i);     
            llOwnerSay(llList2CSV(mylist)); -> result is 20,21,23 but e need 2015,2112,2355 or 20:15,21:12,23:55
        }
    }

     and next result..        llOwnerSay(llList2CSV(mylist)); -> "event_one,new_event,Hello all";  (delet all numbers)

     

    thank you for help.

     

     

  12.  

    string exemple = "abc 123 2015 blue 9988 hello 9 zxcvbnm string list 325698 second life";

    string p = llToLower(exemple);

    list mylist = llParseString2List( p, ["a,b,c,d,e,f,g,h,i,j,l,m,n,o,p,q,r,s,t,u,v,x,z,y,w,k"], []);

     

    I had already tried this way but does not work,
    is not a fixed string, so I need all the letters in llParseString2List..

     

     

×
×
  • Create New...