Balancing balls on top of each other

hi there,

I am wondering if someone could point me in the right direction of where to start or what to research…

I want to create a set of balls on top of each other (think snowman) and by moving your mouse you are trying to balance the balls so that they don’t collapse. I know it will have something to do with angles and if the balls are over a certain angle they fall but I’m pretty baffled as to where to start.

Anyone know of a good place to start, or a tutorial that might help guide me?

thanks in advance