Is there an algorithm for converting quaternion rotations to Euler angle rotations?

This looks like a classic case of old technology being overlooked – I managed to dig out a copy of Graphics Gems IV from the garage and it looks like Ken Shoemake has not only an algorithm for converting from Euler angles of arbitrary rotation order, but also answers most of my other questions on … Read more

Extracting Yaw from a Quaternion

The quaternion representation of rotation is a variation on axis and angle. So if you rotate by r radians around axis x, y, z, then your quaternion q is: q[0] = cos(r/2); q[1] = sin(r/2)*x; q[2] = sin(r/2)*y; q[3] = sin(r/2)*z; If you want to create a quaternion that only rotates around the y axis, … Read more

Component of a quaternion rotation around an axis

There is an elegant solution for this problem, specially suited for quaternions. It is known as the “swing twist decomposition”: in pseudocode /** Decompose the rotation on to 2 parts. 1. Twist – rotation around the “direction” vector 2. Swing – rotation around axis that is perpendicular to “direction” vector The rotation can be composed … Read more

“Average” of multiple quaternions?

Contrary to popular belief in the computer graphics industry, there is a straightforward algorithm to solve this problem which is robust, accurate, and simple that comes from the aerospace industry. It runs in time linear in the number of quaternions being averaged plus a (largish) constant factor. Let Q = [a1q1, a2q2, …, anqn], where … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)