User talk:LindaB Helendale/rot2roll pitch yaw
Revision as of 14:27, 8 August 2015 by Strife Onizuka (talk | contribs) (Created page with "If you just want to change the order, an easier might be something like this: <source lang="lsl2"> vector rot2roll_pitch_yaw(rotation r) { vector ypr = llRot2Euler(<r.z,...")
If you just want to change the order, an easier might be something like this:
vector rot2roll_pitch_yaw(rotation r)
{
vector ypr = llRot2Euler(<r.z, r.y, r.x, r.s>);
return <ypr.z, ypr.y, ypr.x>;
}
rotation roll_pitch_yaw2rot(vector rpy)
{
vector ir = llEuler2Rot(<rpy.z, rpy.y, rpy.x>);
return <ir.z, ir.y, ir.x, ir.s>;
}
I haven't tested it but it should be correct. If the handedness is wrong just add some negatives. -- Strife (talk|contribs) 15:27, 8 August 2015 (PDT)