Comments and answers for "How can I convert a Quaternion to a direction vector?"
http://answers.unity.com/questions/525952/how-i-can-converting-a-quaternion-to-a-direction-v.html
The latest comments and answers for the question "How can I convert a Quaternion to a direction vector?"Comment by edthered1009 on edthered1009's comment
http://answers.unity.com/comments/1604429/view.html
When did he ask for a direction vector? He asked for a Vector3.
> [I] have two Quaternion[s,] and [I] need to convert the two Quaternion[s] to vector3[s.]
.
Pay attention.
Edit: Just realised he did mention direction vectors, but I think he is just using the wrong terms. Thanks for trying to help, though!Wed, 20 Feb 2019 22:20:26 GMTedthered1009Comment by Bunny83 on Bunny83's answer
http://answers.unity.com/comments/1603413/view.html
This makes no sense. Yes, eulerAngles is represented as a Vector3 because it represents 3 angles, but this does not represent a direction vector.Mon, 18 Feb 2019 23:23:25 GMTBunny83Answer by edthered1009
http://answers.unity.com/answers/1603412/view.html
Extremely simple. Quaternion.eulerAngles makes it a Vector3. :)Mon, 18 Feb 2019 23:05:49 GMTedthered1009Comment by Bunny83 on Bunny83's comment
http://answers.unity.com/comments/1433021/view.html
Uhm, what do you mean? Your code example doesn't work. You have to do
Quaternion * Vector
That's what The_Mean_Fiddler said and that's what is written in my answer.
Quaternions basically work like a matrix multiplication which is also right to left. The MVP matrix need to be multiplied in reverse order `P * V * M`Fri, 17 Nov 2017 16:08:33 GMTBunny83Comment by AndyMartin458 on AndyMartin458's answer
http://answers.unity.com/comments/1432987/view.html
Sorry, I had it backwards, thank you for the explanation.Fri, 17 Nov 2017 14:06:03 GMTAndyMartin458Comment by Bunny83 on Bunny83's comment
http://answers.unity.com/comments/1130765/view.html
Some additional information on the [noncommutativity of quaternion multiplication][1]. And just in time there's now a [Numberphile video on quaternions][2] ( [extra bits][3] ) which might help to get a better understanding of how they work.
[1]: https://en.wikipedia.org/wiki/Quaternion#Noncommutativity_of_multiplication
[2]: https://www.youtube.com/watch?v=3BR8tK-LuB0
[3]: https://www.youtube.com/watch?v=ISbJ9S0fzwYThu, 21 Jan 2016 06:00:04 GMTBunny83Comment by Eno-Khaon on Eno-Khaon's comment
http://answers.unity.com/comments/1130742/view.html
> Multiplication is commutative
True. *Multiplication* **IS** commutative.
*Quaternion multiplication*, however, is not commutative. When you multiply with a quaternion, the process can only behave in one manner.
See https://en.wikipedia.org/wiki/Commutative_property for details.Thu, 21 Jan 2016 04:42:14 GMTEno-KhaonComment by Quasimodem on Quasimodem's answer
http://answers.unity.com/comments/1130656/view.html
This caught me too. Multiplication is commutative, dammit!
It'd sure be nice if Unity would add
public static Vector3 operator *(Vector3 point, Quaternion rotation);
to the Quaternion class as well. Normally, you could do this yourself as an extension method, but unfortunately, C# doesn't allow you do make extension methods from operators. Bummer.Wed, 20 Jan 2016 23:39:39 GMTQuasimodemComment by Siloaman on Siloaman's answer
http://answers.unity.com/comments/1113048/view.html
THANK YOU!!!
THIS ONE DETAIL GAVE ME 5 HOURS OF GRIEF!!!
THANK YOU!!!Tue, 15 Dec 2015 22:22:37 GMTSiloamanComment by TheMasonX on TheMasonX's answer
http://answers.unity.com/comments/1110662/view.html
Thanks for the answer! More importantly, thanks for the explanation/clarification of the underlying question in the second half; it really explains WHY this gives the intended result, rather than it being just another abstract operation that spits out the intended result.Fri, 11 Dec 2015 10:14:43 GMTTheMasonXComment by Mr-Mechanical on Mr-Mechanical's answer
http://answers.unity.com/comments/1024719/view.html
Wow. Thank you. This fixed my error!Sun, 09 Aug 2015 05:43:06 GMTMr-MechanicalAnswer by The_Mean_Fiddler
http://answers.unity.com/answers/994863/view.html
You have to do Quaternion * Vector3
Vector3 * Quaternion gives an errorFri, 26 Jun 2015 21:04:05 GMTThe_Mean_FiddlerAnswer by Bunny83
http://answers.unity.com/answers/525956/view.html
A quaternion doesn't have a direction by itself. It is a rotation. It can be used to rotate any vector by the rotation it represents. Just multiply a Vector3 by the quaternion.
Vector3 targetForward = targetRot * Vector3.forward;
Vector3 targetUp = targetRot * Vector3.up;
What axis you need you have to figure out yourself since your code is just an abstract collection of code fragments.
-------
Just to be absolutely clear for beginners: When you say *"Which way is this Quaternion's up?"* or *"Which way does this Quaternion point forward?"* what you **probably actually mean is**:
> "If you take something which is
> standing straight up and forward, and
> **apply the Quaternion to it**, which way is the forward vector now?"
The example code above provides exactly that information.Wed, 28 Aug 2013 22:51:56 GMTBunny83