Simple skeleton in OpenGL using FreeGLUT

Hello, I want to draw simple skeleton of a man using glutSolidSphere and glutSolidCylinder.
I want to have something like this, but in OpenGL:

Image link

So, I want to “connect” spheres using cylinders. I need this for animation. I want to animate those spheres using glTranslatef() and I have no idea how to animate those cylinders. Question is: how to use coordinates of those spheres to animate cylinders? Is it possible?

P.S.
Why I can’t put a url in my post?

New users can’t post image links (avoids spam from new users that have no interest in OpenGL). After a few posts you’ll be able to post image links.

To answer your original question, you first compute the two joint locations in some space. You then find the distance between those two points. That becomes your cylinder height. Before drawing the cylinder, you then put yourself in a space where one joint is at the origin and the other joint is oriented along the +Z axis. Then draw the cylinder.