Virtual Trackball Rotation

I’m struggling to find a good and relatively easily understood example code for a virtual trackball rotation controller. Does anyone have any recommendations?

I’ve read a bit about quaternions. If they are involved in virtual trackball implementation, then hopefully I can learn about those through the example code as well.

Thanks in advance from a relative newbie to OpenGL!

Maybe this

Thanks! The link was very helpful.