Shanbo Baddingham Posted September 8, 2013 Share Posted September 8, 2013 Hey there, I want a command that will rotate a physical object until it's local z axis is pointing straight up. Anyone know how to do this? Link to comment Share on other sites More sharing options...
Shanbo Baddingham Posted September 8, 2013 Author Share Posted September 8, 2013 Hey there, I want a command that will rotate a physical object until it's local z axis is pointing straight up. Anyone know how to do this? Link to comment Share on other sites More sharing options...
Rolig Loon Posted September 8, 2013 Share Posted September 8, 2013 llSetLocalRot( llGetLocalRot() * llRotBetween( <0.0, 0.0,1.0> *llGetLocalRot(), <0.0, 0.0,1.0> ) ); It doesn't make any difference whether the object is physical or not. If you want to rotate its Z axis to point uip, that's how to do it. Link to comment Share on other sites More sharing options...
Shanbo Baddingham Posted September 8, 2013 Author Share Posted September 8, 2013 And if I wanted to point the X axis straight up, would that become llSetLocalRot( llGetLocalRot() * llRotBetween( <1.0, 0.0,0.0> *llGetLocalRot(), <0.0, 0.0,1.0> ) ); And if I wanted to point the Z axis to the left, would that be llSetLocalRot( llGetLocalRot() * llRotBetween( <0.0, 0.0,1.0> *llGetLocalRot(), <1.0, 0.0,0.0> ) ); Just trying to get the format down Link to comment Share on other sites More sharing options...
Rolig Loon Posted September 8, 2013 Share Posted September 8, 2013 That looks right to me. The best way to be sure is to go in world and test, which I can't do at the moment. Link to comment Share on other sites More sharing options...
Shanbo Baddingham Posted September 8, 2013 Author Share Posted September 8, 2013 Hmm, I just did. It didn't do anything I should point out that this is for a root prim, not a child prim. Link to comment Share on other sites More sharing options...
Innula Zenovka Posted September 9, 2013 Share Posted September 9, 2013 I think the problem is that llSetRot and similar don't work on physical prims. In this instance, the simplest method is to use llLookAt(), since that works with both physical and non-physical objects and points the Z axis (rather than the X axis, which is what most functions use) at the specified position. So try something like: integer toggle;default{ state_entry() { llSay(0, "Hello, Avatar!"); } touch_start(integer total_number) { toggle=!toggle; if(toggle){ llLookAt(llGetPos()+<0.0,0.0,1.0>,1.0,0.1); // look at a point 1 metre above me } else{ llStopLookAt(); // turn the lookat off } }} 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