Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Rotations Hurt my head..

ZenMondo Wormser
Registered User
Join date: 19 Mar 2006
Posts: 26
09-15-2006 12:53
Ok so I am using llRotLookAt to rotate a an object towards a desired vector that moves.

What do I have to do so it only spins on the Z axis and keeps the X & Y axis at 0 degrees?

I tried massaging my vector before I hand it over to llRotLookAt, and the darn thing pops up on its side.

What I really need is a mask to keep the Z rotation but to zero-out the X and the Y rotation.

Maybe I can fix it after the llRotLookAt with a llSetRot(llGetRot() * ???what goes here???)
Lazink Maeterlinck
Registered User
Join date: 8 Nov 2005
Posts: 332
09-15-2006 13:41
Use llSetStatus, that should help you stop the rotations on the axis you don't want rotating (although in my experience it sometimes doesn't work).

llSetStatus(STATUS_ROTATE_X, FALSE);
llSetStatus(STATUS_ROTATE_Y, FALSE);

yes you can do it with bit wise orperations, but I find it best to keep them seperate so that you can change them easier.
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
09-15-2006 13:46
Or, if you're rotating something to look at a particular vector, just equalise the x and y positions first.

e.g.

CODE
vector pos_to_look_at = (whatever);
vector mypos = llGetPos();
pos_to_look_at.x = mypos.x;
pos_to_look_at.y = mypos.y;
ZenMondo Wormser
Registered User
Join date: 19 Mar 2006
Posts: 26
09-15-2006 14:50
I got it now. Thank you. For the results I wanted I equalised the z position.