Following on from my previous question, I have now managed to rotate my object with quaternions but there is still a small problem and I dont know how to solve it. With the code below my object rotates round the x and y axis. But it always jumps back to the initial position when I switch between x- and y-key. So I never get a rotation from the new position, but always from the one with which the programm started.
Quaternion q1 = quaternion->quat_rotate(anglex,1,0,0);
Quaternion q2 = quaternion->quat_rotate(angley,0,1,0);
quaternion->mult(q1,q2);
quaternion->quat_matrix(Matrix);
glMultMatrixf(Matrix);
object->drawObject(Red,Green,Blue);
I hope you understand what I mean.