Jump to content

sayua

Resident
  • Posts

    9
  • Joined

  • Last visited

Posts posted by sayua

  1. 10 minutes ago, Mollymews said:

    to get you started then you want

    http://wiki.secondlife.com/wiki/LlSetLinkPrimitiveParamsFast#llSetLinkPrimitiveParamsFast

    the rule you want is PRIM_POSITION used to offset each page prim from the root prim so that the page prim is offscreen, when page ribbon button touched then position the page to onscreen

    root prim typically will contain the ribbon (page) buttons, and the minimise, maximise and close buttons

    what the page offscreen and onscreen positions are depends on the attachment point (left, right, top, bottom, etc) and the size of the prims

    I will learn from that.. thank you molly. really appreciate it

    • Like 1
  2. I working for the HUD, now I use show/hide alpha to display a new window for my HUD.

    but I want to make HUD like maitreya HUD, I think they move a prims to another location, Please help me how to do that.

     

    I attach the image of maitreya HUD

    Thank you

    mait.jpg

    2.jpg

  3. 8 hours ago, Xiija said:

    @sayua

    If you just want a simple rot in place 90 deg, mebbe kinda like ...

    Touch object:

    
    integer ownerChan; 
    default
    {
        state_entry()
        {   ownerChan  = 0x80000000 | (integer)("0x"+(string)llGetOwner() );
        }
        touch_start(integer num)
        {   llRegionSay(ownerChan,"TURN");
        }
    }

    Rotating object:

    
    integer ownerChan;  
    integer Swing = 90;
    rotation Rot;
    default
    {
        state_entry()
        {   Rot = llEuler2Rot( <0.0, 0.0, (float)Swing * DEG_TO_RAD> );
            ownerChan  = 0x80000000 | (integer)("0x"+(string)llGetOwner() );  
            llListen(ownerChan,"","TURN",""); 
        }    
        listen(integer channel, string name, key id, string message)
        {  if( message  == "TURN")
           { llSetLocalRot( Rot  * llGetLocalRot() );
           }
        }
    }

    if you want it to rotate 180 deg, and back to normal, change the 90 to 180 ,

    and change the rotation line  to:

     llSetLocalRot( ZERO_ROTATION / Rot  * llGetLocalRot() );

    thank you @Xiija its working 

    thank you @Rolig Loon

    thank you @Profaitchikenz Haiku

    • Like 1
  4. 2 minutes ago, Profaitchikenz Haiku said:

    I agree, in this case with simple rotation to and fro around the z-axis it will, but

    The wiki is quite definite about the rotation multiplication and division being non-commutative. If rotation1 * rotation2 == rotation2 * rotation1 why state the operation order is important? I can see somebody adapting this script to make adjustments to a chiild prim in more than one axis at a time and coming unstuck.

    I could of course be wrong and I am confident that the usual subjects will be along shortly to put me in my place :)

    I see thank you, can you help me with this script ? so the object (with 2nd button click) back to original position ? 

    thank you so much

  5. 45 minutes ago, Profaitchikenz Haiku said:

    This should  be the other way round, r * rotSwing (r is the actual local rotation, rotSwing is the amount it is to be altered by)

     

    More interestingly though, I can't see how this bit is going to work

     

    state_entry()
            { llListen(-3928573,"","TURN","");
            }
            listen(integer channel, string name, key id, string message)
             {

    You're listening on channel -3928573 for any name talking, with an id of "TURN" , for any message? 

    If it works at all it's because whatever the key value of "TURN" equates to it just happens to be the key of your sender?

     

    thank you for reply

    r * rotSwing or rotSwing*r both are work for me, my problem is the second touch (button) the object didn't come to original position (-90"), its keep moving 90" left

  6. 3 hours ago, Xiija said:

    I put the regionsay in one prim and your script in the other,  and it worked for me?

    yes its work, but the movement bit different with originial script.

    with last script the object turn 360", but with original script the object only turn 90" and second touch the object  back to original position.

    thank you

  7. 16 hours ago, Rolig Loon said:

    I'm not sure that I understand what you are asking for, but it sounds like you just want to be able to rotate your object by clicking on a separate button.  That's easy. All you need to do is take Void's initial script and turn the touch_start event into a listen event.  Open a communication channel in the state_entry event so that the script has something to listen for:

    llListen(-3928573,"","TURN","");

    Put the script into your rotating object.  Then write a second simple switch and put it in your button object:

    
    
    
    default
    {
        touch_start(integer num)
        {
            llRegionSay(-3928573,"TURN");
        }
    }

    All the fun stuff is still done in the rotating object.  The button switch is just a dumb clicker.  

    thank you for reply, 

    yes I want to rotate other object with separate button.

    I try to follow your instruction, maybe I do something wrong, because its not working

    Quote

    integer intSwing =90;
    rotation rotSwing;
    vector vOffset;

    default
    {    

        state_entry()
            { llListen(-3928573,"","TURN","");
            }
            listen(integer channel, string name, key id, string message)
             {
               rotSwing = llEuler2Rot(<0.0,0.0,(float)intSwing>*DEG_TO_RAD);  //90 degrees on the z axis       
               vector size = llGetScale();       
               vOffset = <(size.x*-0.5),(size.y*-0.5),0.0>;//open away from someone standing in front of face 2 -- that is, in front of the prim -- hinged on the left.    
                
            

            
                list l = llGetPrimitiveParams([PRIM_POS_LOCAL,PRIM_ROT_LOCAL]);
                vector v = llList2Vector(l,0);
                rotation r = llList2Rot(l,1);
                llSetPrimitiveParams([PRIM_POS_LOCAL,v+(vOffset-vOffset * rotSwing)*r,PRIM_ROT_LOCAL,rotSwing*r]);
                
                rotSwing.s*=-1;             
             }
    }

    Is it correct script ? Please help, thank you.

     

    • Like 1
  8. Hello, 

    I found a script here, its rotating a object 90" when you touch the object

    here the script

    Quote

    integer intSwing =90;
    rotation rotSwing;
    vector vOffset;

    default{    

        state_entry(){
               rotSwing = llEuler2Rot(<0.0,0.0,(float)intSwing>*DEG_TO_RAD);  //90 degrees on the z axis       
               vector size = llGetScale();       
               vOffset = <(size.x*-0.5),(size.y*-0.5),0.0>;//open away from someone standing in front of face 2 -- that is, in front of the prim -- hinged on the left.    
           }    

            touch_start(integer total_number){
                list l = llGetPrimitiveParams([PRIM_POS_LOCAL,PRIM_ROT_LOCAL]);
                vector v = llList2Vector(l,0);
                rotation r = llList2Rot(l,1);
                llSetPrimitiveParams([PRIM_POS_LOCAL,v+(vOffset-vOffset * rotSwing)*r,PRIM_ROT_LOCAL,rotSwing*r]);
                
                rotSwing.s*=-1;             
            }
    }

    and its work great, but I want create two object, one as button and other one the object that rotating.

    please help me

    thank you

  9. On 3/18/2017 at 11:28 PM, Innula Zenovka said:

    Argh.. the migration to the new IPS forums has messed up my script's formatting

    Here is the corrected version:

    
    integer intSwing =90;
    rotation rotSwing;
    vector vOffset;
    
    default{    
    
    	state_entry(){
    	       rotSwing = llEuler2Rot(<0.0,0.0,(float)intSwing>*DEG_TO_RAD);  //90 degrees on the z axis       
    	       vector size = llGetScale();       
    	       vOffset = <(size.x*-0.5),(size.y*-0.5),0.0>;//open away from someone standing in front of face 2 -- that is, in front of the prim -- hinged on the left.    
           }    
    
    		touch_start(integer total_number){
    			list l = llGetPrimitiveParams([PRIM_POS_LOCAL,PRIM_ROT_LOCAL]);
    			vector v = llList2Vector(l,0);
    			rotation r = llList2Rot(l,1);
    			llSetPrimitiveParams([PRIM_POS_LOCAL,v+(vOffset-vOffset * rotSwing)*r,PRIM_ROT_LOCAL,rotSwing*r]);
    			
    			rotSwing.s*=-1;             
    		}
    }
     
    

     

    thank you, you save my day !

×
×
  • Create New...