Skip to main content
added 6 characters in body
Source Link

To avoid gimball lock you have to use quaternions. Since you are using the GLM library you already have code for that.

q1 = cos(a/2) + i ( x1 * sin(a/2)) + j (y1 * sin(a/2)) + k ( z1 * sin(a/2)) q2 = cos(a/2) + i ( x2 * sin(a/2)) + j (y2 * sin(a/2)) + k ( z2 * sin(a/2)) q3 = cos(a/2) + i ( x3 * sin(a/2)) + j (y3 * sin(a/2)) + k ( z3 * sin(a/2)) a = rotation angle x1, y1, z1 = rotation axis 1 x2, y2, z2 = rotation axis 2 x3, y3, z3 = rotation axis 3 

See http://glm.g-truc.net/0.9.4/api/a00153.html

To avoid gimball lock you have to use quaternions. Since you are using the GLM library you already have code for that.

q1 = cos(a/2) + i ( x1 * sin(a/2)) + j (y1 * sin(a/2)) + k ( z1 * sin(a/2)) q2 = cos(a/2) + i ( x2 * sin(a/2)) + j (y2 * sin(a/2)) + k ( z2 * sin(a/2)) q3 = cos(a/2) + i ( x3 * sin(a/2)) + j (y3 * sin(a/2)) + k ( z3 * sin(a/2)) a = rotation angle x1, y1, z1 = rotation axis x2, y2, z2 = rotation axis x3, y3, z3 = rotation axis 

See http://glm.g-truc.net/0.9.4/api/a00153.html

To avoid gimball lock you have to use quaternions. Since you are using the GLM library you already have code for that.

q1 = cos(a/2) + i ( x1 * sin(a/2)) + j (y1 * sin(a/2)) + k ( z1 * sin(a/2)) q2 = cos(a/2) + i ( x2 * sin(a/2)) + j (y2 * sin(a/2)) + k ( z2 * sin(a/2)) q3 = cos(a/2) + i ( x3 * sin(a/2)) + j (y3 * sin(a/2)) + k ( z3 * sin(a/2)) a = rotation angle x1, y1, z1 = rotation axis 1 x2, y2, z2 = rotation axis 2 x3, y3, z3 = rotation axis 3 

See http://glm.g-truc.net/0.9.4/api/a00153.html

Source Link

To avoid gimball lock you have to use quaternions. Since you are using the GLM library you already have code for that.

q1 = cos(a/2) + i ( x1 * sin(a/2)) + j (y1 * sin(a/2)) + k ( z1 * sin(a/2)) q2 = cos(a/2) + i ( x2 * sin(a/2)) + j (y2 * sin(a/2)) + k ( z2 * sin(a/2)) q3 = cos(a/2) + i ( x3 * sin(a/2)) + j (y3 * sin(a/2)) + k ( z3 * sin(a/2)) a = rotation angle x1, y1, z1 = rotation axis x2, y2, z2 = rotation axis x3, y3, z3 = rotation axis 

See http://glm.g-truc.net/0.9.4/api/a00153.html