Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
2
Question by · Apr 08, 2015 at 01:33 PM · rotationquaternioneulerangleseuler

trouble with Quaternion rotation in 360 axis degree

Good day. I met a problem, with that rotation, exactly in 360 degrees by one of the axis. (in my case- yAxis) Here is a code, how I rotate my object

Quaternion followMouse = Quaternion.FromToRotation(Vector3.right, endPoint - startPoint); Quaternion newQuar = Quaternion.AngleAxis(90, Vector3.right); arrow.transform.rotation = followMouse * newQuar;

So, I got 2 point xPlane, getting angle in Quaternion, from last point to first, and after adding rotation by xAxis (that is always 90 degress) I got troubles only in 1 position, when get 360 degrees in yAxis rotation. At that moment my arrow starts to rotate in all axis by strange values, like 270, 90 degrees..

I found information, that it is kind of problem rotating with Quaternion, but how to solve that problem?

Comment
Add comment · Show 2
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 Nerevar · Apr 08, 2015 at 02:42 PM 0
Share

Hello,

What is the context of this issue? what are you trying to rotate, on what purpose? Because Depending on the situation different solutions could come up to perform a rotation.

And do you really have to use Quaternions?

avatar image · Apr 09, 2015 at 03:18 AM 1
Share

In my case I working with world space UI. Here is example at picture alt text 1 step - clicking and put 1st point 2 step - arrow following cursor. Here is going arrow rotation, and if I got 360 (or 0) degrees by y axis, I get that bug with rotations 3 step - mouse click and set 2nd arrow point

So, for sure I can use

 transform.eulerAngles    = new Vector3(90, follow$$anonymous$$ouse.eulerAngles.y, 0);

but anyway, if I calculate rotation from

 Quaternion follow$$anonymous$$ouse            = Quaternion.FromToRotation(Vector3.right, endPoint - startPoint);

I got a bug in 360 degrees position. At that point that is

 Debug.Log:   follow$$anonymous$$ouse.eulerAngles.y: 1.332716E-05


0 Replies

· Add your reply
  • Sort: 

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

18 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 avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can't Accurately Read Rotations 0 Answers

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

Fixing the rotation around a particular axis using Quaternions? 2 Answers

Need help with storing Rotation in a Quaternion 1 Answer

Object makes random jumps in rotation 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