Difference between revisions of "LlAxisAngle2Rot"

From Second Life Wiki
Jump to navigation Jump to search
(axis has no reason to be normalized)
(Oops)
Line 6: Line 6:
|p2_type=float|p2_name=angle|p2_desc=expressed in radians.
|p2_type=float|p2_name=angle|p2_desc=expressed in radians.
|return_text=that is a generated '''angle''' about '''axis'''
|return_text=that is a generated '''angle''' about '''axis'''
|func_footnote='''axis''' can be not [[llVecNorm|normalized]], only its direction is important, not its length.
|func_footnote='''axis''' can be not [[llVecNorm|normalized]], Only its direction is important, not its length.
|spec
|spec
|caveats
|caveats

Revision as of 08:57, 5 October 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 can be not normalized, Only its direction is important, not its length.

Examples

<lsl>default {

   state_entry()
   {
       vector axis = <0.0, 0.0, 1.0>;
       float angle = 90.0 * DEG_TO_RAD;
       rotation rot = llAxisAngle2Rot(axis, angle);
       vector euler = llRot2Euler(rot) * RAD_TO_DEG;
       llOwnerSay((string) euler);
       //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 );