• 0

# Is there a simple definition for Euler in scripting?

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

## Question

• 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

## 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

• 0

##### 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

##### Share on other sites
• 0

Do you folks agree with this statement? The Euler is the combined out come of all three X, Y, and Z rotations? The Euler being the sum of the X, Y, and Z rotations?

##### Share on other sites
• 0

See this page for  Euler ANGLES rather than the one you mentioned in your original post as it seems much of your confusion may stem from reading about another area of Euler's research:  http://en.wikipedia.org/wiki/Euler_angles

##### Share on other sites
• 0

I think this comes closest to the simple answer:

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.

You get the Kudos

##### Share on other sites
• 0

I've been wondering about this for months so I thought I'd ask, so 4-5 technical pages later. One visit to a scripting group that provided no answers, I find out that X rotation + Y rotation + Z rotation = Euler. Amazing.!

Next time I'll ask a difficult question.

##### Share on other sites
• 0

Hey, these guys say there simpler.

Unit quaternions provide a convenient mathematical notation for representing orientations and rotations of objects in three dimensions. Compared to Euler angles they are simpler to compose and avoid the problem of gimbal lock

Doc you trying to mess with us.

##### Share on other sites

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

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account. ×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.