Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llRot2Fwd() local or global?

Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
05-18-2008 02:50
Is the vector returned by llRot2Fwd() local or global when it is called within a linked child prim?

Don't bother to test it, I can do that, but if you know it from the top of your mind then I would like to know. It is not clear from any WIKI I read.
_____________________
From Studio Dora
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
05-18-2008 02:56
llRot2Fwd isn't either local or global - it just produces the forward vector of whatever rotation you give it. So, it will depend which function you use to get that.
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!

http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal

http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
05-18-2008 03:08
Thanks, that was an eye opener! I had the rotation of it on my mind, but that surely must come from the argument, if the argument is local or global? (say llGetLocalRot() or llGetRot() ).

I still can't get into my thick head why the forward direction can not be relative to the root or global...
llGetLocalPos() and llGetPos() are different in general for a linked prim...
_____________________
From Studio Dora
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
05-18-2008 13:21
I find rotations easiest to think of if I picture little coordinate axes. The rotation is a way of expressing the orientation of one coordinate system in terms of another coordinate system. For example, llGetRot() describes how a prim's local coordinate system (local x, y, and z axes) is oriented relative to the global coordinate system. llGetLocalRot() for a child prim describes how the prim's local coordinate system is oriented relative to the root prim's (local) coordinate axes.

Here's an example. Let's say we have a child prim. If llRot2Fwd(llGetRot()) returns <1.0, 1.0, 0.0>, the child prim's x-axis points between the global coordinate system's x and y axes (north-east). If llRot2Fwd(llGetLocalRot()) returns <1.0, 1.0, 1.0>, the child prim's x-axis points mid-way between all of the root prim's x, y, and z axes. The first is an expression of the child prim's x-axis direction in the global coordinate basis. The second is an expression of the child prim's x-axis direction in the root prim's coordinate basis.