Setting and getting the Z axis of a sphere

Using the quaternionArcBallExample project as a starting point, I am attempting to implement a way of allowing mouse drags to manipulate the Z axis of a sphere (but by creating and rotating an ofSpherePrimitive object instead).

I was hoping it would be as simple as the following:

  1. Using a mouse drag up/down, rotate the sphere around the x axis 90 degrees so that you’re viewing the top of the sphere
  2. Using a mouse drag left/right, rotate the sphere around the y axis 90 degrees so that you’re viewing the side of the sphere.

In my mind I have now created a Z axis rotation compared to the original rotation of the sphere, however I’m assuming I have a fundamental misunderstanding of 3D graphics as calling getRollDeg() doesn’t give me the angle I was expecting.

Is there any way of setting and/or getting the z axis rotation value using the above interaction?