Jump to content

RAD_TO_DEG Help


w1zard
 Share

You are about to reply to a thread that has been inactive for 4634 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

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

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


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
 .

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

You are about to reply to a thread that has been inactive for 4634 days.

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
 Share

×
×
  • Create New...