Comments and answers for "Rotation quaternion to angular velocity"
http://answers.unity.com/questions/49082/rotation-quaternion-to-angular-velocity.html
The latest comments and answers for the question "Rotation quaternion to angular velocity"Comment by julkiewicz on julkiewicz's comment
http://answers.unity.com/comments/1434808/view.html
Wow, can I send you a $100 bill? I just spent hours looking for that answer.
This comment doesn't get enough credit. So basically if you have a quaternion rotation that you want your rigidbody to follow - you assign to rigidbody.angularVelocity what @SergeantBiscuits wrote. Not the original formula.Fri, 24 Nov 2017 05:01:04 GMTjulkiewiczComment by SergeantBiscuits on SergeantBiscuits's answer
http://answers.unity.com/comments/917563/view.html
This is awesome--thank you for posting this. Exactly what I needed.
For anyone else hunting down this information, if you need the relative angular velocity, use:
Vector3 angularSpeed = transform.rotation * (angularDisplacement / Time.deltaTime);Fri, 06 Mar 2015 22:24:13 GMTSergeantBiscuitsAnswer by Nimred
http://answers.unity.com/answers/890259/view.html
This is an old question but I couldn't find a good answer anywhere in Unity Answers, I thought I'd share what I figured out:
- The angular velocity is indeed the rotation axis, normalized, multiplied by the rotation speed in radians.
- Quaternion.ToAngleAxis(out angle, out axis) give a rotation's axis, and the angle IN DEGREES.
So in order to get an angular velocity from a Quaternion, you can do the following:
float angleInDegrees;
Vector3 rotationAxis;
myQuaternion.ToAngleAxis(out angleInDegrees, out rotationAxis);
Vector3 angularDisplacement = rotationAxis * angleInDegrees * Mathf.Deg2Rad;
Vector3 angularSpeed = angularDisplacement / Time.deltaTime;Sat, 31 Jan 2015 15:11:40 GMTNimredComment by hellcats on hellcats's answer
http://answers.unity.com/comments/102407/view.html
One additional detail: the above derivation made the assumption that t (which varies from 0 to 1) is time, but that assumption is only valid if you are using two rotations 1 sec. apart. If your rotations are 1/60 second apart, then you will have to multiply the answer by 60.Fri, 25 Feb 2011 03:48:44 GMThellcatsAnswer by hellcats
http://answers.unity.com/answers/49380/view.html
<p>The problem is that scaling the quaternion won't work because it will no longer be a rotation (it has to be unit length to represent a rotation). The Slerp function does something similar to what you want and is a clue. Here is Slerp:</p>
<pre><code>Slerp(q0, q1, t) = q(t) = (q1 q0*)^t q0
(q0* is Conj[q0], which is the inverse for unit length quaternions)
</code></pre>
<p>This interpolates between two rotations q0 and q1 with t varying from [0, 1].
So if you think of t as being time, then the time derivative dq/dt is:</p>
<pre><code>Log[q1 q0*] (q1 q0*)^t q0
</code></pre>
<p>also,</p>
<pre><code>dq/dt = 1/2 w(t) q(t)
</code></pre>
<p>Note the equivalent form, the Log[q1 q0*] part of dq/dt matches with 1/2 w(t), so the angular velocity is:</p>
<pre><code>2 Log[q1 q0*]
</code></pre>
<p>For unit length quaternions this evaluates to</p>
<pre><code>2 v / ||v|| ArcCos(s)
</code></pre>
<p>where quaterion q is (s, vx, vy, vz) (i.e. s is the scalar part and v the vector part)</p>Fri, 25 Feb 2011 03:19:59 GMThellcatsComment by cregox
http://answers.unity.com/comments/102165/view.html
related: http://answers.unity3d.com/questions/29186/velocity-and-angular-velocity-of-an-object/29190#29190Wed, 23 Feb 2011 17:09:51 GMTcregox