Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Rotation Question

Lucius Obviate
Evil Incarnate
Join date: 5 Dec 2006
Posts: 15
01-25-2008 20:18
I'm trying to create a script that will cause a prim to rotate a specific amount of degrees on the Y axis and the stop and go the opposite direction, rinse and repeat. I'm not all that savvy on rotations and I have been trying to use llRotBetween to no avail thus far so any suggestions are more than welcome.
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
01-25-2008 21:25
Very similar to this one.

/54/8e/236169/1.html
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
01-26-2008 09:44
As that other thread shows, there are several details needed...describe better you need, please.

Rotating Object: Is it pysical? Is it part of something else?
Time: How long does it take to rotate from one position to the other? How long does it pause before returning?
Smooth: How smooth does it have to be?
_____________________
So many monkeys, so little Shakespeare.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-26-2008 10:52
if it doesn't need to be a smooth rotation, just a quick repositioning one, try this thread

essentiall it boils down to a pair of calls that reverse direction each time you use them

//-- local axis rotation version
llSetRot( ourRotation * llGetRot() );
ourRotation.s *=-1

//-- Global axis rotation version
llSetRot( llGetRot() * ourRotation );
ourRotation.s *=-1
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-26-2008 10:57
if it doesn't need to be a smooth rotation, just a quick repositioning one, try this thread

essentiall it boils down to a pair of calls that reverse direction each time you use them

rotation ourRotationAmount = llEuler2Rot( <insert vector degree> * DEG_TO_RAD );

//-- local axis rotation version
llSetRot( ourRotationAmount * llGetRot() );
ourRotationAmount.s *=-1

//-- Global axis rotation version
llSetRot( llGetRot() * ourRotationAmount);
ourRotationAmount.s *=-1

each time one of the above versions is called it will rotate the specified # of degrees on the specified axis, in the opposite direction as the last time
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -