Jump to content

Help with rotation components.


Maelstrom Janus
 Share

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

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

Recommended Posts

Hello Im trying to find a way of rotating a component in my build once it's no longer 'parallel' with the three axes - I'm no scripter - not learned yet - and so Im wading through the terminology to try and make things work. Currently using all the rotation scripts I have if I duplicate the part and move it so its no long parallel the rotation immediately goes wild.

I found a script which would work apart from the fact it only seems to work with two prims....those prims with no script in them dont revolve.. the script claims its good for propellors ...Im wondering how (unless one of the compents is a sculptie) you make a propellor from two prims....can anyone please tell me how I appy this to a build with several prims... Thanks

 //Rotates very slowly around a cylinder's local or global Z axis
 // .... Good for making a propeller that rotates regardless of initial orientation.
 
default
{
    state_entry()
    {
       llTargetOmega(llRot2Up(llGetLocalRot()), PI, 1.0);
    }
}
Link to comment
Share on other sites

If you use llTargetOmega in a script that's in the root prim, the entire linkset will revolve.  If you put it in a child prim, only that prim will revolve. In this particular case, if you want the item to revolve around whatever its local rotation axis it now, don't apply llRot2Up.  That ought to work.

Now, for propellers ... in the old days we used to make propellers by taking a flattened cube prim and applying some twist.  They were pretty crummy looking propellers, though, even if you added a texture to round off the funky sharp corners.  I wouldn't do it that way today.  Just make a simple mesh propeller.  It will have lower L.I. and look loads better.

Link to comment
Share on other sites

18 minutes ago, Rolig Loon said:

If you use llTargetOmega in a script that's in the root prim, the entire linkset will revolve.  If you put it in a child prim, only that prim will revolve. In this particular case, if you want the item to revolve around whatever its local rotation axis it now, don't apply llRot2Up.  That ought to work.

Now, for propellers ... in the old days we used to make propellers by taking a flattened cube prim and applying some twist.  They were pretty crummy looking propellers, though, even if you added a texture to round off the funky sharp corners.  I wouldn't do it that way today.  Just make a simple mesh propeller.  It will have lower L.I. and look loads better.

If you put the script into the root prim the build will revolve around the root prims axes as long as they are parallel with the regions/worlds axis - move the build so theyre not parallel  and the rotation goes totally askew....How do I not apply rot2 up ? Im not a scripter and the minute I tried to remove that from the script good old syntax errors.... Thanks for you help.

 

Edited by Maelstrom Janus
Link to comment
Share on other sites

llTargetOmega sucks when you want to rotate the prim while it's spinning. It's often seen on cars where the front wheels start wobbling when turning the steering wheel.

To keep spinning child prims spinning in alignment, the spin will have to be stopped before it's rotated, and restarted afterwards. like so:

default
{
    state_entry()
    {
       llTargetOmega(<0,0,1> * llGetLocalRot(), PI, 1.0);
    }
    
    touch_start(integer t)
    {
        llTargetOmega(<0,0,0>, 0.0, 0.0);
        llSetLocalRot(llEuler2Rot(<45,0.0,0> * DEG_TO_RAD) * llGetRot());
        llTargetOmega(<0,0,1> * llGetLocalRot(), PI, 1.0);
    }      
}


 

Link to comment
Share on other sites

16 minutes ago, arton Rotaru said:

To keep spinning child prims spinning in alignment, the spin will have to be stopped before it's rotated, and restarted afterwards.

Not quite true.  In this case, if the OP simply wants to keep the propeller spinning around its own X axis, he just needs

            llTargetOmega(<1.0,0.0,0.0> *llGetLocalRot(),PI,1.0);

It doesn't matter how the vehicle turns, the propeller will keep rotating around its own X axis.   And if he wants it to rotate around some other axis, he needs to just change the vector in that function.  So rotating around the Y axis, for example, is

            llTargetOmega(<0.0,1.0,0.0> *llGetLocalRot(),PI,1.0);

Edited by Rolig Loon
Link to comment
Share on other sites

1 minute ago, Rolig Loon said:

Not quite true.  In this case, if the OP simply wants to keep the propeller spinning around its own X axis, he just needs

I should have made that more clear probably. I thought the example of a cars front wheels would make my point clear, but it probably didn't :/.

Link to comment
Share on other sites

Yeah, the business about the car's front wheels is more complicated, because you are rotating the wheel axis relative to the car, which may also be turning.  There, you do have to keep updating with a timer.  (Or rotate the texture on the wheels instead of using llTargetOmega to rotate the wheels on the wheel axis, or throw up your hands and walk away.)

Link to comment
Share on other sites

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