w1zard Posted August 20, 2011 Share Posted August 20, 2011 Hey all,I am looking at http://wiki.secondlife.com/wiki/RotationIt only shows the constant RAD_TO_DEG, no exampleIs anyone able to show me how to convert a rotation 2 vector TyW Link to comment Share on other sites More sharing options...
Acheron Gloom Posted August 20, 2011 Share Posted August 20, 2011 To convert a quaternion representation of rotation to a euler representation you use the function: llRot2Euler(rotation rot); Link to comment Share on other sites More sharing options...
Rolig Loon Posted August 20, 2011 Share Posted August 20, 2011 It's not quite as easy as that. You need to be aware of your frame of reference whenever you work with rotations. Changing a rotation in the regional reference frame will have a very different effect from changing it in a local reference frame, relative to some other object or relative to an attachment point on your avatar. This is probably the most complicated aspect of scripting in LSL. To start learning, read http://wiki.secondlife.com/wiki/Rotation . Link to comment Share on other sites More sharing options...
Void Singer Posted August 20, 2011 Share Posted August 20, 2011 all LSL functions take and return (single) angles in radians..... so if you specify degrees, you have to multiply those values by DEG_TO_RAD, and if you want degrees in the output, you multiply the returns by RAD_TO_DEG..... those two constants are just fractions that convert one measure to another.... like converting feet to meters and back. their values are (pi/180) and (180/pi) respectively, and describe the ratio of (pi[Radians] == 180[Degrees]) Link to comment Share on other sites More sharing options...
Innula Zenovka Posted August 20, 2011 Share Posted August 20, 2011 Rolig Loon wrote: It's not quite as easy as that. You need to be aware of your frame of reference whenever you work with rotations. Changing a rotation in the regional reference frame will have a very different effect from changing it in a local reference frame, relative to some other object or relative to an attachment point on your avatar. This is probably the most complicated aspect of scripting in LSL. To start learning, read http://wiki.secondlife.com/wiki/Rotation . Besides the wiki article -- which I've always found very helpful -- there's three tutorials over at SLU I strongly recommend: http://www.sluniverse.com/php/vb/tutorials/62235-basic-introduction-rotations.html http://www.sluniverse.com/php/vb/tutorials/62479-introduction-rotations-translations-rotation-tutorial.html and http://www.sluniverse.com/php/vb/script-library/40698-kept-simple-rotate-object-towards.html Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now