What I'm really looking for is to get from vector3 to euler angles.
I was thinking of converting a vector3 to a quaternion, and then using the eulerAngles method in the quaternion.
I want to be able to tell how many degrees away from Up the iphone's accelerometer is along a single axis.
Answer by Peter G
Apr 10, 2010 at 11:48 PM
I think you want to use Quaternion.LookRotation() to create a rotation facing that Vector then measure the angle of the new quaternion.
I could have sworn I tried that... Thanks!
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
To help users post good questions and use the site effectively we have posted a user guide. Please check it out.
Answers and Comments
No one has followed this question yet.
Rotate a vector
Making my GambeObject rotate to face the direction of movement, smoothly.
Set rotation based on 1,1,1 style vector? How to convert vector3 to quaternion?
Can I get a normalised Vector3 from a Quaternion?
I keep getting: No appropriate version of 'UnityEngine.Object.Instantiate' for the argument list '(float, UnityEngine.Vector3, UnityEngine.Quaternion)' was found.