Jump to content

Rotate a hud


XbabylonX
 Share

You are about to reply to a thread that has been inactive for 1445 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello,

I made a custom hud for myself, but because it contains many small buttons (prims linked with one basic prim), I want the basic prim to rotate 180 in order to hide the small buttons.

So far Im using the script I found here http://wiki.secondlife.com/wiki/LlRot2Euler , it works the first time I click so it makes the 180 rotation, but when I want to show the buttons again, it does nothing.

Any ideas?

Thank you!

 

Link to comment
Share on other sites

a snippet that may help?

 

 

float amt = 90;default{    state_entry()    {           }    touch_start(integer total_number)    {  llSetLinkPrimitiveParamsFast(1,[PRIM_ROTATION,llGetLocalRot() * llEuler2Rot(<0,0,(amt*=-1)>*DEG_TO_RAD)]);    }}

 

this will rotate a linkset back and forth 90 degrees on the z axis,

by changing the amt variable and multiplying by -1 you change the direction.

( for 180 ... it may spin it around?)

  • Like 2
Link to comment
Share on other sites

most welcome :)

 you can also invert rotations like so ...

 

rotation Rot;default{    state_entry()    {  Rot = llEuler2Rot(<0.0 ,0.0, 90.0>*DEG_TO_RAD);    }    touch_start(integer total_number)    {   llSetRot(Rot*llGetLocalRot());        Rot=ZERO_ROTATION/Rot; //invert the rotation     }}

  ( this will keep a 180 rotation from spinning )

Link to comment
Share on other sites

  • 4 years later...
On 6/5/2015 at 2:55 PM, Xiija said:

a snippet that may help?

 

 


float amt = 90;default{    state_entry()    {           }    touch_start(integer total_number)    {  llSetLinkPrimitiveParamsFast(1,[PRIM_ROTATION,llGetLocalRot() * llEuler2Rot(<0,0,(amt*=-1)>*DEG_TO_RAD)]);    }}

 

this will rotate a linkset back and forth 90 degrees on the z axis,

by changing the amt variable and multiplying by -1 you change the direction.

( for 180 ... it may spin it around?)

I am trying to do a simple flip hud over, a business card so ppl can see the other side, but these scripts are not working.  I have a regular flip prim script but it flips only 90 instead of 180 on the hud, then touching it again, doesnt flip back.  But these scripts dont move the prim on hud at all, what am i doing wrong?

Link to comment
Share on other sites

@Kacie Zapedzki

this seems to work for me...

float amt = 180;
default
{ 
   state_entry() {
   } 
   touch_start(integer total_number) {
      llSetLinkPrimitiveParamsFast( LINK_THIS, [
        PRIM_ROTATION,llGetLocalRot() * llEuler2Rot( <0, 0, (amt*=-1)> * DEG_TO_RAD)
      ]);
   }
 }

 

Edited by Xiija
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1445 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...