$nav ===== Function: llAxisAngle2Rot ===== rotation llAxisAngle2Rot(vector axis, float angle) Returns a [[types/rotation]] resulting from turning over the given axis by the given angle in radians, counter-clockwise when seen from the position the vector points to. For example, if the vector is ''<0, 0, 1>'' and the angle is ''60*DEG_TO_RAD'', it will turn 60 degrees over the Z axis counter-clockwise as seen from above, because the vector points up. ===== Parameters ===== === axis === A [[types/vector]] specifying the axis the rotation will turn around. === angle === A [[types/float]] with the rotation angle, expressed in radians. ===== Return value ===== Returns a [[types/rotation]] that turns over the given axis by the given angle. ===== Short examples ===== // The following example will set "rot" to a rotation that turns 60 degrees // counter-clockwise as seen from above, over the vertical Z axis: rotation rot = llAxisAngle2Rot(<0, 0, 1>, 60*DEG_TO_RAD); ===== Complete examples ===== default { state_entry() { llAxisAngle2Rot(1, 2); } } ===== See also ===== === Opposite conversion === * [[llRot2Axis]] extracts the axis vector of a rotation. * [[llRot2Angle]] extracts the angle of a rotation. === Other conversions between rotation formats === * [[llRot2Fwd]] extracts the X axis of a rotation. * [[llRot2Left]] extracts the Y axis of a rotation. * [[llRot2Up]] extracts the Z axis of a rotation. * [[llAxes2Rot]] converts the three axes of an orthonormal basis (the three vectors above) to a rotation. * [[llRot2Euler]] and [[llEuler2Rot]] work with Euler angles (the ones the viewer shows).