LissomePrey Posted February 27, 2015 Share Posted February 27, 2015 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 More sharing options...
Rolig Loon Posted February 27, 2015 Share Posted February 27, 2015 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 llTargetOmega. Then stop both. Link to comment Share on other sites More sharing options...
LissomePrey Posted February 27, 2015 Author Share Posted February 27, 2015 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 More sharing options...
Rolig Loon Posted February 27, 2015 Share Posted February 27, 2015 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 More sharing options...
LissomePrey Posted February 27, 2015 Author Share Posted February 27, 2015 Thanks Rolig, I want it to slow gradually so better get my maths calculations going. I wasn't doing any calculations just cutting the speed in llTargetOmega on each timer event. Maybe worth contributing the script to the community if I ever sort it Link to comment Share on other sites More sharing options...
irihapeti Posted February 27, 2015 Share Posted February 27, 2015 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 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