Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llSetLocalRot -The Long way around?

ThumpieBunnyEve Hax
Registered User
Join date: 21 Apr 2007
Posts: 3
06-07-2007 11:07
Hello.
I'm having a hair pulling time trying to figure out how to force llSetLocalRot to swing a child prim the -long- way around to it's current, or near current position. to illustrate my desire, |llSetLocalRot.Z:0 -wide swing to- llSetLocalRot.Z:360|. SL likes to take the shortest rout. So even if i properly write the full quaternion for movement from (z:0) to (z:360). what i get is no motion at all. even if i make (z:358) it still automatically takes the shortest path to that spot.

I know your all going to tell me to use llTargetOmega, but before you do, understand this the fallowing:

Once every {llFrand(1)*100;} or so seconds, i want a half circle child prim, to swing around in a loop back to it's _exact_ position and sit there again waiting for the next random interval call. This process needs to be mindful of a smooth start and stop velocity.

llTargetOmega however, has no regard for velocity, nor does it adequately -hault- at a exact position, it just mindlessly rolls around, and ends up on different positions at different times, all sorts of out of sync, for each client close enough to view it.

llSetLocalRot -seems- to be the right thing to use to do this, as it is mindful of velocity while it moves to it's new position, and allways lands on the exact position instructed.

I've already struggled with using 3 rapid calls of llSetLocalRot, to illustrate. I used something similar to the fallowing:

llSetLocalRot.Z:120
llSetLocalRot.Z:240
llSetLocalRot.Z:0

This though appearing to be the right way to do it, fails, because each llSetLocalRot is mindful of velocity to the new position, causing acceleration&velocity changes at positions, 120, 240, -and- 0. (In lamens terms it makes the swing look jerky.)
I -only- want acceleration&velocity changes near the 0 mark. so 3 calls of llSetLocalRot will not suffice.

So, without shaking up a smooth velocity transition from say, (z:0) to (z:358), how do i get it to rotate the long way around?
*@n@;

Dazed&Confused
-ThumpieBunnyEve, The Stumped Technomage. Xpx;;

PS:
LearnSpell = "Fail!"; echo("Oh No'z!" + "Backfire!? O@O!");
Saveingthrow(n)= "huhhuh! No way!";
say(0,"Ahh! 4HP damage!!? Q~Q;");
Object(mage)=*Dies* XP;
End Of File
....return("*cry*");
Jamie Marlin
Ought to be working....
Join date: 13 May 2005
Posts: 43
06-07-2007 15:13
This is a hard one!

Does the object you are rotating need to be a child prim? You can get nice smooth motion using the physical movement function ( llMoveTo() / llRotLookAt() ) by using a relatively long damping constant (tau) and them continuously moving the target *before* the prim arrives at it's destination. (Sample values might be a tau between 0.2 and 0.4 and then update the target position evey 0.1 seconds)

Of course, this may become jerky if the sim lags.

Good luck!
-Jamie
ThumpieBunnyEve Hax
Registered User
Join date: 21 Apr 2007
Posts: 3
06-07-2007 18:16
Yes it needs to be on the child prim. as this is part of a chair.
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
06-07-2007 18:20
I got reasonably smooth motion with the llSetPrimitivePars (..) stuff by breaking the motion into about 30 parts, storing them into a list, and then feeding them out. Moves pretty slow though. Maybe have 4 or 8 helper scripts and feed them the coordinates to move to for each helper script in turn might help