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.
To help users post good questions and use the site effectively we have posted a user guide.
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).
Answers and Comments
No one has followed this question yet.
3D nested Turret Prefab Rotation
Set rotation based on 1,1,1 style vector? How to convert vector3 to quaternion?
LookRotation and Raycasting
I keep getting: No appropriate version of 'UnityEngine.Object.Instantiate' for the argument list '(float, UnityEngine.Vector3, UnityEngine.Quaternion)' was found.
How to rotate an object by direction ?