Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Hopefully simple rotation question

Csteph Submariner
Registered User
Join date: 24 Apr 2007
Posts: 60
12-02-2007 05:56
Hi,

I've done a search on the forums, but I can't seem to find what I'm after.

What I need is to rotate an object in steps, so, I have a timer event which should rotate the object around the local Y axis in steps of (say) 10 degrees. What I am having trouble with is adding the 10 degrees to the current rotation.

I know this is probably simple, but I'm going round in circles (ha!) trying to work it out.

If this has already been dealt with please can someone point me at the thread?

Thanks
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
12-02-2007 08:45
vector vgVecDegrees = <.0, 10.0, .0>; //-- use negative numbers to rotate right
rotation vgRotAmount;

//-- convert to rotation to make quicker calculations
vgRotAmount = llEuler2Rot( vgVecDegrees * DEG_TO_RAD );

//-- each call to this moves 10deg left around the y axis
llSetRot( vgRotAmount * llGetRot() );

I made a page with some simple rotation tasks to help people here
https://wiki.secondlife.com/wiki/User:Void_Singer/Rotations
_____________________
|
| . "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...
| -
Csteph Submariner
Registered User
Join date: 24 Apr 2007
Posts: 60
12-02-2007 15:39
Just the job, thanks!