Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
10
Question by NinjaSquirrel · Feb 21, 2011 at 01:23 AM · rotationquaternioneuleranglesangles

Whats the Difference Between Rotation EulerAngles and Quaternions?

I am very iffy over the three, could someone point out all the differences and uses of them, in dumb terms so I can understand it? Thanks. :)

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
12
Best Answer

Answer by Peter G · Feb 21, 2011 at 01:44 AM

Euler angles are what most people think of when the picture 3d space. Each value represents the rotation in degrees (it could technically be in any units) around one of the 3 axises in 3d space. Also note that Euler angles are the ones displayed in the inspector assuming you are not in debug mode. Most of the time you will want to create angles using eulers because they are conceptually the easier to understand. The flaw is that Euler angles have a problem known as the gimbal lock that prevents certain rotations when two axises align. The solution: quaternions.

Honestly, I don't know what quaternions are. The are a 4 component value represented as (x,y,z,w) and they don't have the problem that Euler angles have. The definition is here, and if you can understand it, then you're a smarter person than me :). It looks like x,y,z,w and are the coefficients of 4 terms in a quaternion. (Over my head)

There are almost 0 instances when you will want to manipulate the values in a quaternion individually, so you really don't need to know how they work unless you plan on creating your own engine, Unity abstractifies most of it away. Instead, use the methods Unity provides and know that the * operator will put the 2 together.

I would recommend learning Euler Angles, they are easy to understand, and very valuable. You can learn how Quaternions work if you want, but you can do almost everything you need to without directly manipulating them. Instead use functions such as Quaternion.Euler() or Quaternion.LookRotation which generates the quaternion for you from a given degree measure or direction.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image NinjaSquirrel · Feb 21, 2011 at 02:12 AM 0
Share

God, that is some crazy physics crap! I definitely need to take that physics class at my high school sooner or later. Oh well, thanks anyways. That gave me a lot to thank about and research when I fell like it :)

avatar image Jesse Anders · Feb 21, 2011 at 11:33 AM 2
Share

One small correction: quaternions are not 'the solution' to gimbal lock. Quaternions don't prevent gimbal lock; in fact, it's just as easy to run into gimbal lock with quaternions as with matrices. What does prevent gimbal lock is not building your orientations in a way that is subject to gimbal lock (which generally means not using 'from scratch' Euler angles).

avatar image Peter G · Feb 21, 2011 at 02:31 PM 0
Share

Thanks Jesse. As I said, I only know the very basics so I appreciate the help.

avatar image cregox · Feb 23, 2011 at 05:41 PM 0
Share

Even if you do know how Quaternions work, don't ever directly manipulate them as it will make your code unreadable to 99% of the community, including your colleagues.

avatar image cregox · Feb 23, 2011 at 05:56 PM 1
Share

Oh, and here's a glimpse of how nearly incomprehensible quaternions are, through a video: http://www.youtube.com/watch?v=lwB7$$anonymous$$zG9awk

avatar image
2

Answer by sirshelley · Jan 29, 2015 at 02:48 PM

Hello from the future and anyone else. Incase you don't want to go and spend a few hours working out the maths proof: In summary quarterion avoids gimble lock as you can never have an angle overlap due the relationship between imaginary and real - you simply get an error or 0 if you try to force an overlap as it literally removes one of the required arguments for the function.
Like with lots of maths concepts it appears there is a consensus to confuse rather than explain. P.s Engineering FTW.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image meat5000 ♦ · Jan 29, 2015 at 03:00 PM 1
Share

Engineering FTW indeed.

If you understand Vectors and you get Complex Numbers, Quaternions are not much of a step further.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Writing a custom LookAt() function 2 Answers

Mouse Orbit on a Different XY Plane? 2 Answers

Matching 2 axes rotation only of 2 gameobjects 1 Answer

Rotation Jumping values (0 to 180) 1 Answer

Is there no way to get reliable angles from a rigidbody? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges