Arcball / Quaternions and 'global' rotation


I’m having difficulties with rotation of a sphere.

Let’s say I want to control my sphere with the mouse and the keyboard.

  1. For the mouse I use an ArcBall (using Quaternions) to control the sphere by dragging the mouse on the screen. Works fine.
  2. I also want to use the keyboard to have the sphere rotate around the global x,y,z axis of the screen.

It’s not difficult to have the sphere rotate around it’s own x,y,z axis but to rotate around the ‘screen’ x,y,z axis is what I cannot manage to do without affecting the orientation of ArcBall.

Anyone an idea on this? I have been searching on internet for a while now but cannot find the right solution to my problem.


Nevermind, I’m improving my Quaternion class.

If anyone knows a very complete Quaternion class easily to be used in OpenFrameworks please let me know.