Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Rotating 360 degrees then stopping!

Katoomi Yoshikawa
Registered User
Join date: 17 May 2007
Posts: 22
01-18-2008 17:37
I am trying to rotate an attachment exactly 360 degrees once. It needs to happen smoothly and in about a second.. or less.

So far, the only way I seem to be able to get close to this is:

llTargetOmega(<0.0,0.0,1.0>,TWO_PI,1.0);
llSleep (1.0);
llTargetOmega(<0.0,0.0,0.0>,TWO_PI,1.0);

But.... this never seems to be exactly 360 degrees.

Is there a way you can set something to rotate once then stop, rather than rotating until you tell it to stop, like i have done above.

Thanks!
KAT^^
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
01-18-2008 21:25
You could probably use llRotLookAt() a few times (3-4), to make sure it is rotating about the correct axis. Leave the final one and the object should come to rest. Or (if it is physical) you could maybe try a llApplyRotationalImpulse() with a quick sleep/loop/timer to catch it when it is close to the full rotation, then another one or a llRotLookAt() to stop the rotation again.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
01-19-2008 06:48
The way you USED to be able to do it was

llTargetOmega(<0.0,0.0,1.0>,radians/time,1.0);
llSleep(time);
llTargetOmega(<0.0,0.0,1.0>,0,1.0);
llSetPos(original_pos);

But llSetPos will no longer correct llTargetOmega calls and is a known issue. It used to work pretty good but was never 100% accurate, depends entirely on sim conditions.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Katoomi Yoshikawa
Registered User
Join date: 17 May 2007
Posts: 22
01-19-2008 08:25
I was trying something similar to this with SetRot, but still having problems. Is there a way to set a rotation degree in relation to an attachment point? So after the rotation is complete I can align it to a set position?

I had no success with the target options. Not sure if this is to do with it being an attachment or not.. but it was fun dropping some blocks on the sandbox floor for a bit and watching them bounce about.... made a nice break from the frustration of scripting!

Its annoying that you cant just command something to rotate a set number in degrees in a specified direction. Like spin clockwise on X axis through 360 degrees... without having to start a rotation and let it go until you stop it.

From my fiddling.. it looks like SetRot should do it, but i can't make it work properly... tho i guess thats more to do with me being a scripting noob than lack of the correct commands!!
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
01-19-2008 10:20
llSetRot doesn't spin the object thou, it instead jumps over to the rotation that is set. That is the difference and the root of the problem. You can't spin llSetRot and even thou llTargetOmega seemingly "spins" the object, it's rotation actually never changes. So it is live with llTargetOmega like it is presently borked or play around with llRotLookAt as Hewee suggested.

per the wiki(llSetRot):

"Beginners are often confused about the difference between this function and llTargetOmega. llTargetOmega makes the object SPIN with the specified angular velocity. llSetRot just turns it ONCE to face in a particular direction.
&&
When an object is non-physical (the more common use) the effect is simulated purely on the client ("client-side";) and not the server"
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
01-19-2008 11:33
Unless you make the object physical. Then llTargetOmega() DOES update its actual server-side orientation. But you may not want a physical object. I suppose you could try doing a llMoveToTarget() to keep it in place, and maybe turning it physical and phantom just long enough to do its thing....
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
01-26-2008 09:38
Just a thought...can you rotate the texture instead of the object?
_____________________
So many monkeys, so little Shakespeare.