Jump to content
  • 0
Sign in to follow this  
Faubio Alter

Is there a simple definition for Euler in scripting?

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

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×