XbabylonX Posted October 12, 2014 Share Posted October 12, 2014 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 More sharing options...
Rolig Loon Posted October 12, 2014 Share Posted October 12, 2014 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 More sharing options...
XbabylonX Posted October 12, 2014 Author Share Posted October 12, 2014 Thank you Rolig for your answer. Your modified code works very well but its not making a 180 degrees turn. I changed the value where the PI is and still I cant make it show the correct face. Link to comment Share on other sites More sharing options...
Rolig Loon Posted October 13, 2014 Share Posted October 13, 2014 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. 1 Link to comment Share on other sites More sharing options...
XbabylonX Posted October 13, 2014 Author Share Posted October 13, 2014 You are correct, I was lost at the faces Thank you for your help. Link to comment Share on other sites More sharing options...
Recommended Posts
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