Difference between revisions of "LlEuler2Rot"

From Second Life Wiki
Jump to navigation Jump to search
(The explanation text seemed to refer to <1,0,0>*llEuler2Rot(<1,2,3>*DEG_TO_RAD) but the example had no vector along the X axis. Remove the vector which is unnecesary.)
m
Line 9: Line 9:
|caveats
|caveats
|constants
|constants
|examples=<lsl>default
|examples=<source lang="lsl2">default
{
{
     state_entry()
     state_entry()
Line 17: Line 17:
         llSay(0,"The Euler2Rot of "+(string)input+" is: "+(string)rot );
         llSay(0,"The Euler2Rot of "+(string)input+" is: "+(string)rot );
     }
     }
}</lsl>
}</source>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llRot2Euler]]|}}
|also_functions={{LSL DefineRow||[[llRot2Euler]]|}}
Line 23: Line 23:
|also_tests
|also_tests
|also_articles={{LSL DefineRow||{{Wikipedia|Euler Angles}}|}}
|also_articles={{LSL DefineRow||{{Wikipedia|Euler Angles}}|}}
|notes=<lsl>v/=2;
|notes=<source lang="lsl2">v/=2;
rotation k = <0.0, 0.0, llSin(v.z), llCos(v.z)> * <0.0, llSin(v.y), 0.0, llCos(v.y)> * <llSin(v.x), 0.0, 0.0, llCos(v.x)>;</lsl>
rotation k = <0.0, 0.0, llSin(v.z), llCos(v.z)> * <0.0, llSin(v.y), 0.0, llCos(v.y)> * <llSin(v.x), 0.0, 0.0, llCos(v.x)>;</source>
|permission
|permission
|negative_index
|negative_index

Revision as of 00:21, 22 January 2015

Summary

Function: rotation llEuler2Rot( vector v );
0.0 Forced Delay
10.0 Energy

Returns a rotation representation of Euler Angles v.

• vector v Angle

Specification

The Euler angle vector (in radians) is converted to a rotation by doing the rotations around the 3 axes in Z, Y, X order. So llEuler2Rot(<1.0, 2.0, 3.0> * DEG_TO_RAD) generates a rotation by first rotating 3 degrees around the global Z axis, then rotating the result around the global Y axis, and finally rotating that 1 degree around the global X axis.

Examples

default
{
    state_entry()
    {
        vector input = <73.0, -63.0, 20.0> * DEG_TO_RAD;
        rotation rot = llEuler2Rot(input);
        llSay(0,"The Euler2Rot of "+(string)input+" is: "+(string)rot );
    }
}

Notes

v/=2;
rotation k = <0.0, 0.0, llSin(v.z), llCos(v.z)> * <0.0, llSin(v.y), 0.0, llCos(v.y)> * <llSin(v.x), 0.0, 0.0, llCos(v.x)>;

See Also

Functions

•  llRot2Euler

Articles

•  "Wikipedia logo"Euler Angles

Deep Notes

Signature

function rotation llEuler2Rot( vector v );