Jump to content

Rotating a prim set as a hud


XbabylonX
 Share

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

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

Recommended Posts

Hello,

Im not so familiar with lsl but rotating a single prim was so easy to acomplish, but as a prim set I spent 2 days with no success.

I have 2 prims linked (for using it as a hud), the parent and the child one. I need when clicking on the child, the whole set to be rotated 180 degrees.

Can someone help me?

Thank you in advanced.

Link to comment
Share on other sites

As a demo, make a simple HUD by linking two cubes (0.1 x 0.1 x 0.1 m) on top of each other.  Color each of the faces (1,2,3,4) a different color.  Then drop this script into it.

default{    touch_start(integer total_number)    {        integer link = llDetectedLinkNumber(0);        rotation LRot = llList2Rot(llGetLinkPrimitiveParams(link,[PRIM_ROT_LOCAL]),0);        llSetLinkPrimitiveParamsFast(link,[PRIM_ROT_LOCAL,llEuler2Rot(<0.0,0.0,PI/2>)*LRot]);    }}

 When you touch the root prim, both of the prims will rotate 90 degrees around the vertical axis.  When you click the child prim, only the child prim will rotate.

ETA:  Oh, if you want the entire thing to rotate ONLY when you click on the child prim, modify it like so ...

default{    touch_start(integer total_number)    {        integer link = llDetectedLinkNumber(0);        if (link != 1)        {            llSetLinkPrimitiveParamsFast(1,[PRIM_ROT_LOCAL,llEuler2Rot(<0.0,0.0,PI/2>)*llGetLocalRot()]);        }    }}

 

 

Link to comment
Share on other sites

PI/2 is 90 degrees, PI is 180 degrees.  Changing that Z value is all it should take.

BTW, I am assuming that your own HUD is built in the standard way, with its local +Z axis pointing UP and it local +X axis pointing directly away from you -- into the screen.  That is, if your HUD is a basic cube, you are looking at its face #4.

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3475 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...