How can i convert quaternion to vector3 values ? #132
Unanswered
suryanadiminti99
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I took a look on the mentioned Repository for this Website and found this formula var axis = [0, 0, 0];
var angle = 2 * Math.acos(q.w);
if (1 - (q.w * q.w) < 0.000001)
{
axis[0] = q.x;
axis[1] = q.y;
axis[2] = q.z;
}
else
{
// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/
var s = Math.sqrt(1 - (q.w * q.w));
axis[0] = q.x / s;
axis[1] = q.y / s;
axis[2] = q.z / s;
} I guess that is what you want? If so here is the blueprint, the conversion to java shouldn't be to hard :) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Team, How can I convert my quaternion to vector3 values.
below is the reference link for the online converter. But how can I implement the same in java?
@ThomasGorisse
https://www.andre-gaschler.com/rotationconverter/
Beta Was this translation helpful? Give feedback.
All reactions