rotating composite objects with OpenGL
I've embarked on a self-led journey into OpenGL (like many others I presume). At the moment I can work through the tutorials I have found and can do some simple stuff independently. But I'd like to do more. One thing I'd like to do is attempt to rotate a composite object. I searched the board but came up with no solutions.
Here's a simple scenario. Say I have a bar made up of two cubes. One cube has alternating white and black faces and the other has alternating red and blue faces. Each cube has an X, Y, and Z axis and independently could spin on each axis. When connected together into a bar however the two cubes can only spin on their X axis. The question comes in if I want to animate the process of flipping the bar so the white/black cube is on the right hand side of the bar instead of the left. Is it possible to rotate the entire bar about it's Y axis (which would be the interface between the two cubes if the cubes were of the same size)? Or do you have to do the math and flip each component cube separately?
A similar situation would arise if you were to draw a snowman's face using a sphere for the head, a cone for the nose, and two smaller spheres for the eyes. How could you animate the snowman so the whole head (face in total, nose, and eyes) all rotate together?
A slightly more advanced scenario would be this. Say you have two bars that interlock perpendicular to each other at their middle third. Can you rotate each bar about the common midpoint independent of the other bar? If so, how do you do that, in general terms (although any detail or referrals would be gladly accepted as well).