I was able to calculate the vertical rotation.
I tried combining them both but seeing as the world offset is based on vectors instead of quaternions I seem to be getting some flipping of the coordinates at times. Perhaps a more math savy person could help make it more stable.
High res
pure code
material.txt (162.6 KB)
I’m guessing the inconsistency may come from the input orientation. One probably needs the information fed from the previous transform.