Jump to content

Rotating Child Prims


Recommended Posts

I'm have a cylinder that is cut into five pieces I want to rotate those pieces as if there was a stick going the center. I'm using this 

float y = 90;
float yh = 90;
integer yt = 90;
integer yth = 90;
integer  One = FALSE;
integer  Two = FALSE;
integer  Three = FALSE;
integer x;
integer t;
integer th;
float   gap = 30.0;
rotation rot_xyzs;

       // llSetLinkPrimitiveParamsFast( 5, [PRIM_ROT_LOCAL, llEuler2Rot(<0.0, 0.0 , 0.0>*DEG_TO_RAD)] );
       // llSetLinkPrimitiveParamsFast(2, [ 
  //  PRIM_ROT_LOCAL, llEuler2Rot(<0, 0, 0>*DEG_TO_RAD)]);
     //   llSetLinkPrimitiveParamsFast(4, [ 
//    PRIM_ROT_LOCAL, llEuler2Rot(<0, 0, 0>*DEG_TO_RAD)]);
     //   llSetLinkPrimitiveParamsFast(5, [ 
 //   PRIM_ROT_LOCAL, llEuler2Rot(<0, 0, 0>*DEG_TO_RAD)])
     //   llSetLinkPrimitiveParamsFast(3, [ 
 //   PRIM_ROT_LOCAL, llEuler2Rot(<0, 0, 0>*DEG_TO_RAD)]);

    touch_start(integer total_number)
        if (llDetectedLinkNumber(0)==5)

        vector xyz_angles = <y,1.0,1.0>; // This defines a 1 degree change on the Y axis
        vector angles_in_radians = xyz_angles*DEG_TO_RAD; // Change to radians
        rot_xyzs = llEuler2Rot(angles_in_radians);

llSetLinkPrimitiveParamsFast( 5, [PRIM_ROT_LOCAL, llEuler2Rot(<0.0, 0.0, y>*DEG_TO_RAD)] );
  //        llSetLinkPrimitiveParamsFast(6, [ 
  //  PRIM_ROT_LOCAL, llEuler2Rot(<y, 0.0, 0.0>*DEG_TO_RAD)]);
    // x++; 

but it seems that the first click it is setting itself to a start point before rotating. Any ideas?

Link to comment
Share on other sites

I am not at all sure what you're trying to do there.    

However, what you are telling it to do, is to set itself to an angle of 90 degrees on on the positive z axis.

If you want to tell it to rotate through  90 degrees from whatever angle it's at when you touch it, then try

rotation r = llList2Rot(llGetLinkPrimitiveParams(5,[PRIM_ROT_LOCAL]),0);
llSetLinkPrimitiveParamsFast( 5, [PRIM_ROT_LOCAL, llEuler2Rot(<0.0, 0.0, y>*DEG_TO_RAD) * r] );

(I think that should work -- not tested though).

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...