"As I said before I would avoid using Euler rotation. The outcome is not the same when you rotate around X, then around Z as if you do Z, then X. Furthermore: what you read in the editor depends on which mode you are in, global or local."
Apparently the issue is regarding that when "rotation rezRot=llGetLocalRot()*myRot*llGetRootRotation();" is performed though i have tried changing this sequence.
"Furthermore: what you read in the editor depends on which mode you are in, global or local."
Not quite sure what you mean on this one. I am manually rezzing the object I want the script to rez, orienting it's rotation as I want it be rezzed to, and starting from those numbers. How would that be changing between a "global or local mode"?
"What I would do was make a small script to tell me the rotation (as a quaternion) of the prim when it is placed the way I want."
Yes not knowing how to make the script itself do the calculating, I tried this as an attempt at a "calculator" script dropped into the intended rezzed object with a desired rotation:
rotation thequaternionlocal;
rotation thequaternion;
vector as_a_vector;
vector local_as_a_vector;
float component_x;
float component_y;
float component_z;
float rcomponent_x;
float rcomponent_y;
float rcomponent_z;
float lcomponent_x;
float lcomponent_y;
float lcomponent_z;
float lrcomponent_x;
float lrcomponent_y;
float lrcomponent_z;
default
{
touch_start(integer total_number)
{
//Get the rotation of the child prim
thequaternionlocal = llGetLocalRot();
thequaternion = llGetRot();
// Convert it to a vector
as_a_vector = llRot2Euler(thequaternion);
local_as_a_vector = llRot2Euler(thequaternionlocal);
//Get the x, y & z components of that vector and convert to degrees
component_x = as_a_vector.x * RAD_TO_DEG;
component_y = as_a_vector.y * RAD_TO_DEG;
component_z = as_a_vector.z * RAD_TO_DEG;
rcomponent_x = as_a_vector.x;
rcomponent_y = as_a_vector.y;
rcomponent_z = as_a_vector.z;
lcomponent_x = local_as_a_vector.x * RAD_TO_DEG;
lcomponent_y = local_as_a_vector.y * RAD_TO_DEG;
lcomponent_z = local_as_a_vector.z * RAD_TO_DEG;
lrcomponent_x = local_as_a_vector.x;
lrcomponent_y = local_as_a_vector.y;
lrcomponent_z = local_as_a_vector.z;
// Say the vector components
llOwnerSay("The rotation in degrees is <" + (string)( component_x) + ", " + (string)( component_y) + ", " +(string)( component_z) + " > ");
llOwnerSay("The rotation in radians is <" + (string)( rcomponent_x) + ", " + (string)( rcomponent_y) + ", " +(string)( rcomponent_z) + " > ");
llOwnerSay("The local rotation in degrees is <" + (string)( lcomponent_x) + ", " + (string)( lcomponent_y) + ", " +(string)( lcomponent_z) + " > ");
llOwnerSay("The local rotation in radians is <" + (string)( lrcomponent_x) + ", " + (string)( lrcomponent_y) + ", " +(string)( lrcomponent_z) + " > ");
llOwnerSay("thequaternionlocal is " + (string)thequaternionlocal);
llOwnerSay("thequaternion is " + (string)thequaternion);
}
}
An example result was:
[14:22] Fork: The rotation in degrees is <78.983185, 1.988623, -179.555481 >
[14:22] Fork: The rotation in radians is <1.378517, 0.034708, -3.133834 >
[14:22] Fork: The local rotation in degrees is <78.983185, 1.988623, -179.555481 >
[14:22] Fork: The local rotation in radians is <1.378517, 0.034708, -3.133834 >
[14:22] Fork: thequaternionlocal is <-0.01092, 0.63592, -0.77155, 0.01403>
[14:22] Fork: thequaternion is <-0.01092, 0.63592, -0.77155, 0.01403>
Perhaps I got confused in doing the calculation I need but tried these and it did not get me there. one issue being i did not undertand how to incorporate the 4 variable quaternian result into the the script.
"Finally: I may have misunderstood what it is that you want. Wasn't it a rezzed prim with the Z axis pointing same way as the Z axis in a child prim?"
Yes that's what I want to achieve, and your method does that if i had a way to figure out what rotations to feed it, either using as you said a calculation script or in the script itself using the edit window rotations.
Sorry to be such a pain, rotations just make my head spin (pun semi-intended).