Difference between revisions of "LlAxisAngle2Rot"

From Second Life Wiki
Jump to navigation Jump to search
Line 9: Line 9:
|spec
|spec
|caveats
|caveats
|examples
|examples=<lsl>default
{
    state_entry()
    {
        rotation rTest=llAxisAngle2Rot(<0.0, 0.0, 1.0>, (90.0*DEG_TO_RAD));
        vector eTest=llRot2Euler(rTest)*RAD_TO_DEG;
 
        llOwnerSay((string) eTest);
 
        //Says <0.0, 0.0, 90.0> since it is rotating 90 degrees on the Z axis caused by the 1.0 placed in the Z vector spot.
    }
 
}</lsl>
 
|helpers
|helpers
|also_functions=
|also_functions=

Revision as of 17:56, 10 April 2008

Summary

Function: rotation llAxisAngle2Rot( vector axis, float angle );

Returns a rotation that is a generated angle about axis

• vector axis
• float angle expressed in radians.

axis should be normalized.

Examples

<lsl>default {

   state_entry()
   {
       rotation rTest=llAxisAngle2Rot(<0.0, 0.0, 1.0>, (90.0*DEG_TO_RAD));
       vector eTest=llRot2Euler(rTest)*RAD_TO_DEG;
       llOwnerSay((string) eTest);
       //Says <0.0, 0.0, 90.0> since it is rotating 90 degrees on the Z axis caused by the 1.0 placed in the Z vector spot. 
   }
}</lsl>

See Also

Functions

•  llRot2Angle
•  llRot2Axis

Deep Notes

Search JIRA for related Issues

Signature

function rotation llAxisAngle2Rot( vector axis, float angle );