Jump to content

Rotating to a Halt


LissomePrey
 Share

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

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

Recommended Posts

I am trying to get an object (table) to spin round the z axis gradually slowing and ending up aligned to a compass point.

I have got the slowing working fine but I am having problems getting it to stop aligned and would welcome any suggestions.

My first thought was llGetRot() as it slowed past a certain speed of rotation and stopping when it next hit a compass point but llRot2Euler(llGetRot()) always seems to return a zero rotation for me.

Would be grateful for any thoughts, suggestions or pointers to scripts.

Link to comment
Share on other sites

If you have been "rotating" with llTargetOmega, the servers don't have any idea that you have been doing it.  All llTargetOmega rotation is client side.  When you query llGetRot(), you'll see that nothing has changed in the servers.  So, if you want to stop at a specific spot, you have to rotate with llSetLinkPrimitiveParams  ([PRIM_ROTATION]) as well as llTargetOmegaThen stop both.

Link to comment
Share on other sites

Thanks for the help.

llSetLinkPrimitiveParams  ([PRIM_ROTATION]) sets it to a specific rotation if I read correctly? So I'd need to do my own calculationof how far it had rotated at each time interval if I went that way.

I guess the best bet is to calculate roughly what starting speed of llTargetOmega would get me to each compass point (results of course are not exactly repeatable) and then as speed of rotation gets to zero, correct with llSetLinkPrimitiveParams  ([PRIM_ROTATION]). I thought this was going to be an easy one, very foolish.

Link to comment
Share on other sites

Yes, that's right.  You put the SLPPF function in a timer loop and let it increment the rotation in discrete steps of 10 degrees or so while llTargetOmega is showing you a smooth rotation on your client.  The stepwise rotation will be in the background, not seen by your viewer until you stop everything.  It's not hard, really.  After all, you can apply the same calculated rotation to both functions.

Link to comment
Share on other sites

you on the right track

one way to do it is on the last revolution have the omega stop about 1 degree short of the target. Then use SLPPF to bring it home in tiny fractional steps

as it will be going really slowly by then any viewable jitter will/should be minimally visible

eta tpyo 

Link to comment
Share on other sites

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