Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 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
14
Question by MonkeyAssassin8 · Jul 24, 2011 at 04:00 AM · quaternionscriptingbasics

What is affected by the W in Quaternion(x,y,z,w)?

I'm just wondering what is affected by the 'w' parameter in Quaternion...

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

3 Replies

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

Answer by keld-oelykke · Jul 28, 2011 at 10:02 PM

  • a quaternion is a complex number with w as the real part and x, y, z as imaginary parts.

  • If a quaternion represents a rotation then w = cos(theta / 2), where theta is the rotation angle around the axis of the quaternion.

  • The axis v(v1, v2, v3) of a rotation is encoded in a quaternion: **x = v1 sin (theta / 2), y = v2 sin (theta / 2), z = v3 sin (theta / 2)*.

  • If w is 1 then the quaternion defines 0 rotation angle around an undefined axis v = (0,0,0).

  • If w is 0 the quaternion defines a half circle rotation since theta then could be +/- pi.

  • If w is -1 the quaternion defines +/-2pi rotation angle around an undefined axis v = (0,0,0).

  • A quater circle rotation around a single axis causes w to be +/- 0.5 and x/y/z to be +/- 0.5.

Kind Regards, Keld Ølykke

Comment
Add comment · Show 3 · 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 unityBerserker · Jun 12, 2019 at 05:45 PM 0
Share

alt text

xyz.png (28.5 kB)
avatar image unityBerserker unityBerserker · Jun 12, 2019 at 05:46 PM 0
Share

alt text

tablew.png (80.8 kB)
avatar image unityBerserker unityBerserker · Jun 12, 2019 at 05:46 PM 0
Share

alt text

cos-alfa05.png (53.2 kB)
avatar image
6

Answer by Eric5h5 · Jul 24, 2011 at 05:14 AM

Quaternions are four-dimensional, so you need four properties. The x/y/z properties don't correspond to x/y/z in euler angles. With quaternions, each of the properties is a normalized float between 0 and 1, so for example a euler angle of 45/90/180 is represented by a quaternion as approximately .65/-.27/.65/.27.

Comment
Add comment · 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
0

Answer by testure · Jul 24, 2011 at 04:18 AM

If you don't already know, it's not something that's easily explained unfortunately.

Have a read

Comment
Add comment · Show 2 · 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 tomi-trescak · Feb 12, 2018 at 01:47 AM 3
Share

$$anonymous$$ade my day ;) As one of the most useless comments out there. Why bother?

avatar image Bunny83 tomi-trescak · Feb 12, 2018 at 04:09 AM 0
Share

You may better watch the numberphile video on quaternions. Dr James Grime does a great job explaining the very basics.

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

12 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

slow rotation over time? 1 Answer

Storing camera angles for a FPS -1 Answers

Tilt object x degrees, smoothly 0 Answers

Function update 1 Answer

How to make door open and close with Input.GetButtonDown? 1 Answer


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