Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llGetRot/llSetRot question

Azrael Baphomet
Registered User
Join date: 13 Sep 2005
Posts: 93
01-09-2006 11:13
Hi, this is a (mercifully I hope) brief question involving the proper usage of the rotation calls. From reading the wiki, it seems like llGetRot sets the rotation of the object on an axis through the root prim of the object. However, looking at rotation in world, it seems like llGetRot performs a rotation around an axis going through the center of the entire object....

This is a vital issue for me, and my undying love and admiration will go to the person who offers the most concise explanation of how llGetRot/llSetRot works.
Newfie Pendragon
Crusty and proud of it
Join date: 19 Dec 2003
Posts: 1,025
01-09-2006 11:21
From: Azrael Baphomet
Hi, this is a (mercifully I hope) brief question involving the proper usage of the rotation calls. From reading the wiki, it seems like llGetRot sets the rotation of the object on an axis through the root prim of the object. However, looking at rotation in world, it seems like llGetRot performs a rotation around an axis going through the center of the entire object....

This is a vital issue for me, and my undying love and admiration will go to the person who offers the most concise explanation of how llGetRot/llSetRot works.



My experience has been the following:

- When using the in-world rotation interface (the 3D spin handles, the object would be rotated around its center of mass, rather than the root prim.
- When using the up/down arrows in the edit window, it would rotate based on the root prim.
- When in script (for example via llSetRot()), it would rotate based on the root prim.


My rule of thumb has been that if I absolutely needed to manually rotate an object around a root prim, I'd use the up/down arrows in the edit window.

- Newfie
_____________________
Azrael Baphomet
Registered User
Join date: 13 Sep 2005
Posts: 93
01-09-2006 11:32
From: Newfie Pendragon
My experience has been the following:

- When using the in-world rotation interface (the 3D spin handles, the object would be rotated around its center of mass, rather than the root prim.
- When using the up/down arrows in the edit window, it would rotate based on the root prim.
- When in script (for example via llSetRot()), it would rotate based on the root prim.


My rule of thumb has been that if I absolutely needed to manually rotate an object around a root prim, I'd use the up/down arrows in the edit window.

- Newfie


So there is a difference between the in world tool rotation of objects and the scripting language rotation calls? That's irksome.
If I rotate an object using the GUI tools (around the center of mass) and want that object to return to me the exact rotation of that object after the operation, it's not going to be enough to invoke llGetRot()?

Quaternions are where my brain goes to die (and I'm no slouch mathematically speaking). So if you have any further insight as to how to get the same exact rotation returned to me after using the tools (so I can implement it later using the scripting calls) I'd appreciate it.
Rickard Roentgen
Renaissance Punk
Join date: 4 Apr 2004
Posts: 1,869
01-09-2006 14:30
The rotation will be correct, however if you use the win world tools (the colored circles) the objects position will change.
_____________________
Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
01-09-2006 14:42
Right, the rotation will be correct, but the position will be different.

There is a function to get the position of the center of mass of the linkset I believe, and using that and assuming the GUI rotation is indeed around the center of mass, then it should be possible to script something to take account of that offset.
_____________________
-Seifert Surface
2G!tGLf 2nLt9cG