Jump to content
  • 0

Is there a simple definition for Euler in scripting?


Faubio Alter
 Share

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

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

Question

11 answers to this question

Recommended Posts

  • 0

Simple? Maybe to someone who has a masters in mathematics. Euler rotation is expressed as the usual x,y,and z plus a 4th element I do not understand, even after researching it, even after talking to mathematicians about it. So in LSL we convert it back and forth using llEuler2Rot and llRot2Euler. I've given up trying to understand it. I just use it and it works

Link to comment
Share on other sites

  • 0

Actually that is incorrect. A euler rotation is a vector , <x,y,z> expressed in radians. Quaternions are a 4 number vector , x,y,z and s. Here is the wiki info on Euler -

Euler vector

Another way to represent a 3D angle is using three numbers, <X, Y, Z>, which represent the amount which the object is rotated around each axis. This is used in the Edit window, for example, and is generally easy for people to visualize. It is easy to adjust the Rotation <x, y, z> numbers in the Edit window and see how the object behaves. Note that in the Edit window, the numbers are in degrees, that is, a right angle is 90.

In LSL, these three angles are expressed in radians instead of degrees, that is, a right angle is PI/2. (A radian is sort of a very fat degree.) Note that these three numbers are a vector type and not a rotation type, though it can represent the same information. This is called the Euler representation of a 3D angle. In LSL the rotation around z is done first, then around y, and finally around x.

 

Basically you are describing the final position by saying, if I rotate this object on its Z axis a certain amount, then on its Y axis a certain amount and then finally on its X axis a certain amount, it will end up at the desired position. This is not the same result you would get by simply rotating each axis in a random order by the same amount. Try it in world and maybe it will make more sense.

There are some good conversion functions for changing rotation (quarternion) to euler and euler to degress that can make scripiting rotations easier.

The full wiki info on rotation can be found here:

http://wiki.secondlife.com/wiki/Rotation

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 5216 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...